Skip to content

Commit 2b0d259

Browse files
feat: Support ESLint 7.x (#92)
* feat: Support ESLint 7.x * fix: Fix ESLint errors * Update .travis.yml * chore: Update dependencies * chore: Update dependencies * fix: Cleanup yarn.lock * fix: Fix ESLint errors * chore: Don't check for engines in tests * [Breaking] drop support for all but eslint 6/7, and jest 25/26 * Add engines to make the minimum required Node version more clear * Update ESLint plugins to latest version Co-authored-by: Jordan Harband <[email protected]>
1 parent 6d1c78d commit 2b0d259

File tree

5 files changed

+1458
-1542
lines changed

5 files changed

+1458
-1542
lines changed

.travis.yml

Lines changed: 13 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,21 @@
11
language: node_js
22
node_js:
3-
- '12'
4-
- '10'
5-
- '8'
6-
- '6'
3+
# eslint 7: node 10.12+
4+
# jest 26: node 10.14.2+
5+
- 14
6+
- 12
7+
- 10
78
install:
8-
- 'yarn add "eslint@${ESLINT}" "jest@${JEST}" "babel-jest@${JEST}"'
9-
- 'yarn'
9+
- 'yarn add "eslint@${ESLINT}" "jest@${JEST}" "babel-jest@${JEST}" --ignore-engines'
10+
- 'yarn --ignore-engines'
1011
env:
11-
- 'ESLINT=4 JEST=24'
12-
- 'ESLINT=5 JEST=24'
13-
- 'ESLINT=6 JEST=24'
14-
- 'ESLINT=4 JEST=25'
15-
- 'ESLINT=5 JEST=25'
1612
- 'ESLINT=6 JEST=25'
17-
- 'ESLINT=4 JEST=26'
18-
- 'ESLINT=5 JEST=26'
13+
- 'ESLINT=7 JEST=25'
1914
- 'ESLINT=6 JEST=26'
15+
- 'ESLINT=7 JEST=26'
2016
matrix:
21-
exclude:
22-
# exclude eslint 6 on node 6
23-
- node_js: '6'
24-
env: 'ESLINT=6 JEST=24'
25-
- node_js: '6'
17+
# jest 25: node 8+
18+
include:
19+
# eslint 6, node 8
20+
- node_js: 8
2621
env: 'ESLINT=6 JEST=25'
27-
# exclude jest 25 on node 6
28-
- node_js: '6'
29-
env: 'ESLINT=4 JEST=25'
30-
- node_js: '6'
31-
env: 'ESLINT=5 JEST=25'
32-
- node_js: '6'
33-
env: 'ESLINT=6 JEST=25'
34-
# exclude jest 25 on node 8
35-
- node_js: '8'
36-
env: 'ESLINT=4 JEST=25'
37-
- node_js: '8'
38-
env: 'ESLINT=5 JEST=25'
39-
- node_js: '8'
40-
env: 'ESLINT=6 JEST=25'
41-
# exclude jest 26 on node 6
42-
- node_js: '6'
43-
env: 'ESLINT=4 JEST=26'
44-
- node_js: '6'
45-
env: 'ESLINT=5 JEST=26'
46-
- node_js: '6'
47-
env: 'ESLINT=6 JEST=26'
48-
# exclude jest 26 on node 8
49-
- node_js: '8'
50-
env: 'ESLINT=4 JEST=26'
51-
- node_js: '8'
52-
env: 'ESLINT=5 JEST=26'
53-
- node_js: '8'
54-
env: 'ESLINT=6 JEST=26'

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,35 @@
2727
"chalk": "^2.4.1",
2828
"cosmiconfig": "^5.0.0",
2929
"create-jest-runner": "^0.5.3",
30-
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0"
30+
"eslint": "^6 || ^7"
3131
},
3232
"devDependencies": {
3333
"@babel/cli": "^7.1.0",
3434
"@babel/core": "^7.1.0",
3535
"@babel/preset-env": "~7.7.0",
3636
"babel-jest": "^25.1.0",
37-
"eslint-config-airbnb-base": "^13.1.0",
38-
"eslint-config-prettier": "^4.3.0",
39-
"eslint-plugin-import": "^2.14.0",
40-
"eslint-plugin-jest": "^22.6.4",
41-
"eslint-plugin-prettier": "^3.1.0",
37+
"eslint-config-airbnb-base": "^14.2.0",
38+
"eslint-config-prettier": "^6.11.0",
39+
"eslint-plugin-import": "^2.22.0",
40+
"eslint-plugin-jest": "^23.17.1",
41+
"eslint-plugin-prettier": "^3.1.4",
4242
"execa": "^1.0.0",
43-
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0",
43+
"jest": "^25.1 || ^26",
4444
"jest-watch-select-projects": "^0.1.1",
4545
"jest-watch-typeahead": "^0.3.1",
4646
"prettier": "^1.14.3",
4747
"rimraf": "^2.6.2"
4848
},
4949
"peerDependencies": {
50-
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0",
51-
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0"
50+
"eslint": "^6 || ^7",
51+
"jest": "^25.1 || ^26"
5252
},
5353
"prettier": {
5454
"proseWrap": "never",
5555
"singleQuote": true,
5656
"trailingComma": "all"
57+
},
58+
"engines": {
59+
"node": ">=8.10.0"
5760
}
5861
}

src/utils/normalizeConfig.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,18 @@ const normalizeCliOptions = rawConfig =>
114114

115115
const value = rawConfig[key] !== undefined ? rawConfig[key] : defaultValue;
116116

117-
return Object.assign({}, config, {
117+
return {
118+
...config,
118119
[name]: transform(value),
119-
});
120+
};
120121
}, {});
121122
/* eslint-enable no-param-reassign */
122123

123124
const normalizeConfig = config => {
124-
return Object.assign({}, config, {
125+
return {
126+
...config,
125127
cliOptions: normalizeCliOptions(config.cliOptions || {}),
126-
});
128+
};
127129
};
128130

129131
module.exports = normalizeConfig;

src/watchFixPlugin/__tests__/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('watchFixPlugin', () => {
1212
beforeEach(() => {
1313
jest.resetModules();
1414
configOverrides = require('../../utils/configOverrides');
15-
WatchFixPlugin = require('../');
15+
WatchFixPlugin = require('..');
1616
});
1717

1818
it('shows the correct prompt', async () => {

0 commit comments

Comments
 (0)