Skip to content

Commit

Permalink
feat: Support ESLint 7.x (#92)
Browse files Browse the repository at this point in the history
* 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 <ljharb@gmail.com>
  • Loading branch information
MichaelDeBoey and ljharb committed Jul 4, 2020
1 parent 6d1c78d commit 2b0d259
Show file tree
Hide file tree
Showing 5 changed files with 1,458 additions and 1,542 deletions.
59 changes: 13 additions & 46 deletions .travis.yml
@@ -1,54 +1,21 @@
language: node_js
node_js:
- '12'
- '10'
- '8'
- '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'
- '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
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"
}
}
10 changes: 6 additions & 4 deletions src/utils/normalizeConfig.js
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
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

0 comments on commit 2b0d259

Please sign in to comment.