Skip to content

Commit

Permalink
Add ESLint 6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmckeb committed Jul 23, 2019
1 parent ad51d62 commit a78d4aa
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"compile:lockfile": "node tasks/compile-lockfile.js"
},
"devDependencies": {
"eslint": "5.16.0",
"eslint": "6.1.0",
"execa": "1.0.0",
"fs-extra": "^7.0.1",
"get-port": "^4.2.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ module.exports = {
'no-obj-calls': 'warn',
'no-octal': 'warn',
'no-octal-escape': 'warn',
'no-redeclare': 'warn',
// TODO: Remove this option in the next major release of CRA.
// https://eslint.org/docs/user-guide/migrating-to-6.0.0#-the-no-redeclare-rule-is-now-more-strict-by-default
'no-redeclare': ['warn', { builtinGlobals: false }],
'no-regex-spaces': 'warn',
'no-restricted-syntax': ['warn', 'WithStatement'],
'no-script-url': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"@typescript-eslint/eslint-plugin": "1.x",
"@typescript-eslint/parser": "1.x",
"babel-eslint": "10.x",
"eslint": "5.x",
"eslint-plugin-flowtype": "2.x",
"eslint": "6.x",
"eslint-plugin-flowtype": "3.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-react": "7.x",
Expand Down
12 changes: 6 additions & 6 deletions packages/react-error-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
"@babel/code-frame": "7.0.0",
"@babel/core": "7.4.3",
"anser": "1.4.8",
"babel-eslint": "10.0.1",
"babel-eslint": "10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "8.0.5",
"babel-preset-react-app": "^9.0.0",
"chalk": "^2.4.2",
"chokidar": "^2.1.2",
"cross-env": "5.2.0",
"eslint": "^5.16.0",
"eslint": "^6.1.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-flowtype": "3.12.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.14.3",
"flow-bin": "^0.63.1",
"html-entities": "1.2.1",
"jest": "24.7.1",
Expand Down
20 changes: 10 additions & 10 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"dependencies": {
"@babel/core": "7.4.3",
"@svgr/webpack": "4.3.1",
"@typescript-eslint/eslint-plugin": "1.10.2",
"@typescript-eslint/parser": "1.10.2",
"babel-eslint": "10.0.1",
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
"babel-eslint": "10.0.2",
"babel-jest": "^24.8.0",
"babel-loader": "8.0.5",
"babel-plugin-named-asset-import": "^0.3.2",
Expand All @@ -42,14 +42,14 @@
"css-loader": "2.1.1",
"dotenv": "6.2.0",
"dotenv-expand": "4.2.0",
"eslint": "^5.16.0",
"eslint": "^6.1.0",
"eslint-config-react-app": "^4.0.1",
"eslint-loader": "2.1.2",
"eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-react": "7.12.4",
"eslint-plugin-react-hooks": "^1.5.0",
"eslint-loader": "2.2.1",
"eslint-plugin-flowtype": "3.12.1",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.14.3",
"eslint-plugin-react-hooks": "^1.6.1",
"file-loader": "3.0.1",
"fs-extra": "7.0.1",
"html-webpack-plugin": "4.0.0-beta.5",
Expand Down
12 changes: 6 additions & 6 deletions packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ module.exports = (resolve, rootDir, isEjecting) => {
];
if (overrides) {
supportedKeys.forEach(key => {
if (overrides.hasOwnProperty(key)) {
if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
if (Object.prototype.hasOwnProperty.call(overrides, key)) {
if (Array.isArray(config[key]) || typeof config[key] !== 'object') {
// for arrays or primitive types, directly override the config key
config[key] = overrides[key];
config[key] = overrides[key];
} else {
// for object types, extend gracefully
config[key] = Object.assign({}, config[key], overrides[key]);
}
config[key] = Object.assign({}, config[key], overrides[key]);
}

delete overrides[key];
}
});
Expand Down

0 comments on commit a78d4aa

Please sign in to comment.