Skip to content

Commit

Permalink
feat: update to eslint@5
Browse files Browse the repository at this point in the history
BREAKING CHANGE: remove object-spread addon, use es9 instead
  • Loading branch information
satazor committed Aug 6, 2018
1 parent 2c576e5 commit 07793b7
Show file tree
Hide file tree
Showing 14 changed files with 1,792 additions and 1,713 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Then enhance it with one or more **addons**:
- `browser` - If you are going to develop code for the browser (assumes you use CommonJS or AMD)
- `node` - If you are going to develop code for [NodeJS](nodejs.org)
- `es6-modules`: If you are going to use ES6 import & export instead of CommonJS or AMD
- `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)
- `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)
- `react` - If you are going to use [React](https://reactjs.org/) (requires `es6` base configuration or higher)
- `jest` - If you are going to use [Jest](https://facebook.github.io/jest/) to develop tests
Expand All @@ -57,35 +56,35 @@ Cutting edge react in the browser:
{
"root": true,
"extends": [
"eslint-config-moxy/es8",
"eslint-config-moxy/es9",
"eslint-config-moxy/addons/browser",
"eslint-config-moxy/addons/es6-modules",
"eslint-config-moxy/addons/react"
]
}
```

ES6 with modules in NodeJS (requires a transpiler such as Babel or similar):
Cutting edge in NodeJS:

```json
{
"root": true,
"extends": [
"eslint-config-moxy/es6",
"eslint-config-moxy/addons/node",
"eslint-config-moxy/addons/es6-modules"
"eslint-config-moxy/es9",
"eslint-config-moxy/addons/node"
]
}
```

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

```json
{
"root": true,
"extends": [
"eslint-config-moxy/es6",
"eslint-config-moxy/addons/node"
"eslint-config-moxy/es9",
"eslint-config-moxy/addons/node",
"eslint-config-moxy/addons/es6-modules"
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion addons/babel-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
'plugins': ['babel'],
'rules': {
// Require constructor names to begin with a capital letter
'babel/new-cap': [2, { 'newIsCap': true }],
'babel/new-cap': 2,
'new-cap': 0,
// Enforce consistent spacing inside braces
'babel/object-curly-spacing': [2, 'always'],
Expand Down
16 changes: 0 additions & 16 deletions addons/object-spread.js

This file was deleted.

7 changes: 7 additions & 0 deletions es9.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ module.exports = {
'ecmaVersion': 2018,
'sourceType': 'script',
},
'plugins': [
'prefer-object-spread',
],
'rules': {
// Require object spread properties to be used instead of Object.assign()
'prefer-object-spread/prefer-object-spread': 2,
},
};
Loading

0 comments on commit 07793b7

Please sign in to comment.