Skip to content

Commit

Permalink
Add node10 sub-config
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanZim committed Dec 5, 2018
1 parent 8f2b866 commit d22867f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Expand Up @@ -51,17 +51,25 @@ By default `eslint-config-problems` forces the use of ES2015+ features supported
- `prefer-rest-params` - Use rest parameters instead of `arguments`.
- `prefer-const` - I realize this is very opinionated; if you don't like it, add `prefer-const: off` to your config.

### `node8` sub-config
### I disagree with rule X; you missed rule Y

If you disagree; feel free to open an issue. I'm open to changing rules if you have a good reason.

If I missed a rule that prevents an actual problem or is otherwise in keeping with the general guidelines above, please open an issue as well; I just might add it.

## sub-configs

### `node8`

There is a sub-config, accessible at `problems/node8`, which forces ES features supported by Node.js 8+. Specifically, it enforces the use of the exponentiation operator instead of `Math.pow()`.

It also sets `ecmaVersion: 2017` in the `parserOptions`, so that ESLint can parse `async`/`await` code with no additional setup.

### I disagree with rule X; you missed rule Y
### `node10`

If you disagree; feel free to open an issue. I'm open to changing rules if you have a good reason.
The `problems/node10` sub-config forces ES2018 features supported by Node.js v10+. Specifically, it disallows the use of `Object.assign()` where the object spread operator could be used.

If I missed a rule that prevents an actual problem or is otherwise in keeping with the general guidelines above, please open an issue as well; I just might add it.
It also sets `ecmaVersion: 2018` in the `parserOptions`, so that ESLint can parse the ES2018 syntax that Node.js v10 supports.

## Installation & Usage

Expand Down
10 changes: 10 additions & 0 deletions node10.js
@@ -0,0 +1,10 @@
'use strict';
module.exports = {
extends: 'problems/node8',
parserOptions: {
ecmaVersion: 2018,
},
rules: {
'prefer-object-spread': 'error',
},
};

0 comments on commit d22867f

Please sign in to comment.