Skip to content

Commit 07793b7

Browse files
committed
feat: update to eslint@5
BREAKING CHANGE: remove object-spread addon, use es9 instead
1 parent 2c576e5 commit 07793b7

File tree

14 files changed

+1792
-1713
lines changed

14 files changed

+1792
-1713
lines changed

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ Then enhance it with one or more **addons**:
4343
- `browser` - If you are going to develop code for the browser (assumes you use CommonJS or AMD)
4444
- `node` - If you are going to develop code for [NodeJS](nodejs.org)
4545
- `es6-modules`: If you are going to use ES6 import & export instead of CommonJS or AMD
46-
- `object-spread`: Allows to use [object rest spread](https://github.com/tc39/proposal-object-rest-spread) when destructuring objects (not necessary if you are using the `es9` base configuration)
4746
- `babel-parser`: Use [babel-eslint](https://github.com/babel/babel-eslint) parser so that you may use language features that are not yet implemented in eslint (e.g.: dynamic imports)
4847
- `react` - If you are going to use [React](https://reactjs.org/) (requires `es6` base configuration or higher)
4948
- `jest` - If you are going to use [Jest](https://facebook.github.io/jest/) to develop tests
@@ -57,35 +56,35 @@ Cutting edge react in the browser:
5756
{
5857
"root": true,
5958
"extends": [
60-
"eslint-config-moxy/es8",
59+
"eslint-config-moxy/es9",
6160
"eslint-config-moxy/addons/browser",
6261
"eslint-config-moxy/addons/es6-modules",
6362
"eslint-config-moxy/addons/react"
6463
]
6564
}
6665
```
6766

68-
ES6 with modules in NodeJS (requires a transpiler such as Babel or similar):
67+
Cutting edge in NodeJS:
6968

7069
```json
7170
{
7271
"root": true,
7372
"extends": [
74-
"eslint-config-moxy/es6",
75-
"eslint-config-moxy/addons/node",
76-
"eslint-config-moxy/addons/es6-modules"
73+
"eslint-config-moxy/es9",
74+
"eslint-config-moxy/addons/node"
7775
]
7876
}
7977
```
8078

81-
Use ES6 in NodeJS without any transpiler:
79+
Cutting edge with modules in NodeJS (requires a transpiler such as Babel or similar):
8280

8381
```json
8482
{
8583
"root": true,
8684
"extends": [
87-
"eslint-config-moxy/es6",
88-
"eslint-config-moxy/addons/node"
85+
"eslint-config-moxy/es9",
86+
"eslint-config-moxy/addons/node",
87+
"eslint-config-moxy/addons/es6-modules"
8988
]
9089
}
9190
```

addons/babel-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
'plugins': ['babel'],
66
'rules': {
77
// Require constructor names to begin with a capital letter
8-
'babel/new-cap': [2, { 'newIsCap': true }],
8+
'babel/new-cap': 2,
99
'new-cap': 0,
1010
// Enforce consistent spacing inside braces
1111
'babel/object-curly-spacing': [2, 'always'],

addons/object-spread.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

es9.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ module.exports = {
88
'ecmaVersion': 2018,
99
'sourceType': 'script',
1010
},
11+
'plugins': [
12+
'prefer-object-spread',
13+
],
14+
'rules': {
15+
// Require object spread properties to be used instead of Object.assign()
16+
'prefer-object-spread/prefer-object-spread': 2,
17+
},
1118
};

0 commit comments

Comments
 (0)