Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support ESLint 7.x #92

Merged
merged 11 commits into from
Jul 4, 2020
59 changes: 13 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,21 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
- '6'
# eslint 7: node 10.12+
# jest 26: node 10.14.2+
- 14
- 12
- 10
install:
- 'yarn add "eslint@${ESLINT}" "jest@${JEST}" "babel-jest@${JEST}"'
- 'yarn'
- 'yarn add "eslint@${ESLINT}" "jest@${JEST}" "babel-jest@${JEST}" --ignore-engines'
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
- 'yarn --ignore-engines'
env:
- 'ESLINT=4 JEST=24'
- 'ESLINT=5 JEST=24'
- 'ESLINT=6 JEST=24'
- 'ESLINT=4 JEST=25'
- 'ESLINT=5 JEST=25'
- 'ESLINT=6 JEST=25'
- 'ESLINT=4 JEST=26'
- 'ESLINT=5 JEST=26'
- 'ESLINT=7 JEST=25'
- 'ESLINT=6 JEST=26'
- 'ESLINT=7 JEST=26'
matrix:
exclude:
# exclude eslint 6 on node 6
- node_js: '6'
env: 'ESLINT=6 JEST=24'
- node_js: '6'
# jest 25: node 8+
include:
# eslint 6, node 8
- node_js: 8
env: 'ESLINT=6 JEST=25'
# exclude jest 25 on node 6
- node_js: '6'
env: 'ESLINT=4 JEST=25'
- node_js: '6'
env: 'ESLINT=5 JEST=25'
- node_js: '6'
env: 'ESLINT=6 JEST=25'
# exclude jest 25 on node 8
- node_js: '8'
env: 'ESLINT=4 JEST=25'
- node_js: '8'
env: 'ESLINT=5 JEST=25'
- node_js: '8'
env: 'ESLINT=6 JEST=25'
# exclude jest 26 on node 6
- node_js: '6'
env: 'ESLINT=4 JEST=26'
- node_js: '6'
env: 'ESLINT=5 JEST=26'
- node_js: '6'
env: 'ESLINT=6 JEST=26'
# exclude jest 26 on node 8
- node_js: '8'
env: 'ESLINT=4 JEST=26'
- node_js: '8'
env: 'ESLINT=5 JEST=26'
- node_js: '8'
env: 'ESLINT=6 JEST=26'
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,35 @@
"chalk": "^2.4.1",
"cosmiconfig": "^5.0.0",
"create-jest-runner": "^0.5.3",
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0"
"eslint": "^6 || ^7"
},
"devDependencies": {
"@babel/cli": "^7.1.0",
"@babel/core": "^7.1.0",
"@babel/preset-env": "~7.7.0",
"babel-jest": "^25.1.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^22.6.4",
"eslint-plugin-prettier": "^3.1.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^23.17.1",
"eslint-plugin-prettier": "^3.1.4",
"execa": "^1.0.0",
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0",
"jest": "^25.1 || ^26",
"jest-watch-select-projects": "^0.1.1",
"jest-watch-typeahead": "^0.3.1",
"prettier": "^1.14.3",
"rimraf": "^2.6.2"
},
"peerDependencies": {
"eslint": "^4.0.0 || ^5.0.0 || ^6.0.0",
"jest": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.1.0 || ^26.0.0"
"eslint": "^6 || ^7",
"jest": "^25.1 || ^26"
},
"prettier": {
"proseWrap": "never",
"singleQuote": true,
"trailingComma": "all"
},
"engines": {
"node": ">=8.10.0"
}
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
}
10 changes: 6 additions & 4 deletions src/utils/normalizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,18 @@ const normalizeCliOptions = rawConfig =>

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

return Object.assign({}, config, {
return {
...config,
[name]: transform(value),
});
};
}, {});
/* eslint-enable no-param-reassign */

const normalizeConfig = config => {
return Object.assign({}, config, {
return {
...config,
cliOptions: normalizeCliOptions(config.cliOptions || {}),
});
};
};

module.exports = normalizeConfig;
2 changes: 1 addition & 1 deletion src/watchFixPlugin/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('watchFixPlugin', () => {
beforeEach(() => {
jest.resetModules();
configOverrides = require('../../utils/configOverrides');
WatchFixPlugin = require('../');
WatchFixPlugin = require('..');
});

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