Skip to content

Commit b4a5376

Browse files
MichaelDeBoeyljharb
andcommitted
feat: Support ESLint 7.x
Co-authored-by: Michaël De Boey <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
1 parent 6d1c78d commit b4a5376

File tree

6 files changed

+1116
-1087
lines changed

6 files changed

+1116
-1087
lines changed

.travis.yml

Lines changed: 67 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,94 @@
11
language: node_js
22
node_js:
3-
- '12'
4-
- '10'
5-
- '8'
6-
- '6'
3+
# eslint 7: node 10+
4+
# jest 26: node 10+
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+
- 'if [ "${ESLINT-}" = 4 ]; then yarn add eslint-config-airbnb-base@13 --ignore-engines; fi'
11+
- 'yarn --ignore-engines'
1012
env:
13+
- 'ESLINT=4 JEST=21'
14+
- 'ESLINT=5 JEST=21'
15+
- 'ESLINT=6 JEST=21'
16+
- 'ESLINT=7 JEST=21'
17+
- 'ESLINT=4 JEST=22'
18+
- 'ESLINT=5 JEST=22'
19+
- 'ESLINT=6 JEST=22'
20+
- 'ESLINT=7 JEST=22'
21+
- 'ESLINT=4 JEST=23'
22+
- 'ESLINT=5 JEST=23'
23+
- 'ESLINT=6 JEST=23'
24+
- 'ESLINT=7 JEST=23'
1125
- 'ESLINT=4 JEST=24'
1226
- 'ESLINT=5 JEST=24'
1327
- 'ESLINT=6 JEST=24'
28+
- 'ESLINT=7 JEST=24'
1429
- 'ESLINT=4 JEST=25'
1530
- 'ESLINT=5 JEST=25'
1631
- 'ESLINT=6 JEST=25'
32+
- 'ESLINT=7 JEST=25'
1733
- 'ESLINT=4 JEST=26'
1834
- 'ESLINT=5 JEST=26'
1935
- 'ESLINT=6 JEST=26'
36+
- 'ESLINT=7 JEST=26'
2037
matrix:
21-
exclude:
22-
# exclude eslint 6 on node 6
38+
# jest 21: 4+
39+
# jest 22: 6+
40+
# jest 25: 8+
41+
include:
42+
# eslint 4, node 4/6/8
43+
- node_js: '4'
44+
env: 'ESLINT=4 JEST=21'
2345
- node_js: '6'
24-
env: 'ESLINT=6 JEST=24'
25-
- node_js: '6'
26-
env: 'ESLINT=6 JEST=25'
27-
# exclude jest 25 on node 6
46+
env: 'ESLINT=4 JEST=21'
47+
- node_js: '8'
48+
env: 'ESLINT=4 JEST=21'
2849
- node_js: '6'
29-
env: 'ESLINT=4 JEST=25'
50+
env: 'ESLINT=4 JEST=22'
51+
- node_js: '8'
52+
env: 'ESLINT=4 JEST=22'
3053
- node_js: '6'
31-
env: 'ESLINT=5 JEST=25'
54+
env: 'ESLINT=4 JEST=23'
55+
- node_js: '8'
56+
env: 'ESLINT=4 JEST=23'
3257
- node_js: '6'
33-
env: 'ESLINT=6 JEST=25'
34-
# exclude jest 25 on node 8
58+
env: 'ESLINT=4 JEST=24'
3559
- node_js: '8'
36-
env: 'ESLINT=4 JEST=25'
60+
env: 'ESLINT=4 JEST=24'
3761
- node_js: '8'
38-
env: 'ESLINT=5 JEST=25'
62+
env: 'ESLINT=4 JEST=25'
63+
64+
# eslint 5, node 6/8
65+
- node_js: '6'
66+
env: 'ESLINT=5 JEST=21'
3967
- node_js: '8'
40-
env: 'ESLINT=6 JEST=25'
41-
# exclude jest 26 on node 6
68+
env: 'ESLINT=5 JEST=21'
4269
- node_js: '6'
43-
env: 'ESLINT=4 JEST=26'
70+
env: 'ESLINT=5 JEST=22'
71+
- node_js: '8'
72+
env: 'ESLINT=5 JEST=22'
4473
- node_js: '6'
45-
env: 'ESLINT=5 JEST=26'
74+
env: 'ESLINT=5 JEST=23'
75+
- node_js: '8'
76+
env: 'ESLINT=5 JEST=23'
4677
- node_js: '6'
47-
env: 'ESLINT=6 JEST=26'
48-
# exclude jest 26 on node 8
78+
env: 'ESLINT=5 JEST=24'
79+
- node_js: '8'
80+
env: 'ESLINT=5 JEST=24'
4981
- node_js: '8'
50-
env: 'ESLINT=4 JEST=26'
82+
env: 'ESLINT=5 JEST=25'
83+
84+
# eslint 6, node 8
5185
- node_js: '8'
52-
env: 'ESLINT=5 JEST=26'
86+
env: 'ESLINT=6 JEST=21'
5387
- node_js: '8'
54-
env: 'ESLINT=6 JEST=26'
88+
env: 'ESLINT=6 JEST=22'
89+
- node_js: '8'
90+
env: 'ESLINT=6 JEST=23'
91+
- node_js: '8'
92+
env: 'ESLINT=6 JEST=24'
93+
- node_js: '8'
94+
env: 'ESLINT=6 JEST=25'

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
projects: [
99
{
1010
displayName: 'e2e',
11+
testEnvironment: 'node',
1112
testPathIgnorePatterns: [
1213
'/examples/',
1314
'/node_modules/',
@@ -21,10 +22,12 @@ module.exports = {
2122
},
2223
{
2324
displayName: 'tests',
25+
testEnvironment: 'node',
2426
testMatch: ['<rootDir>/src/**/__tests__/**/*.js'],
2527
},
2628
{
2729
displayName: 'lint',
30+
testEnvironment: 'node',
2831
runner: './',
2932
testPathIgnorePatterns: [
3033
'/examples/',

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
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": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
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.21.2",
40+
"eslint-plugin-jest": "^23.13.2",
41+
"eslint-plugin-prettier": "^3.1.3",
4242
"execa": "^1.0.0",
4343
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0",
4444
"jest-watch-select-projects": "^0.1.1",
@@ -47,7 +47,7 @@
4747
"rimraf": "^2.6.2"
4848
},
4949
"peerDependencies": {
50-
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0",
50+
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0",
5151
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0"
5252
},
5353
"prettier": {

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)