forked from jaegertracing/jaeger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ESLint and related plugins (jaegertracing#1250)
## Which problem is this PR solving? - Contributes towards jaegertracing#1199 ## Short description of the changes Bump ESLint to v7 and update related plugins. Suppress newly introduced or updated rules in a separate config section so that they can be evaluated and enabled later, except for stylistic rules that do not match the existing code style, or where the impact was limited enough to be trivially fixable or suppressable. `@typescript-eslint/eslint-plugin` now validates that input files are indeed part of the tsconfig file configured in ESLint options. Since the plugin doesn't understand project references, this requires a small change to [specify the package-specific tsconfig files for linting](https://typescript-eslint.io/linting/typed-linting/monorepos#one-tsconfigjson-per-package-and-an-optional-one-in-the-root) instead. Also remove `eslint-config-react-app` (the CRA ESLint config), as it doesn't actually seem to bring much to the table—the Airbnb config seems to overwrite much of the same rules that this config is trying to provide. I ran `eslint --print-config packages/jaeger-ui/src/components/App/index.jsx` and `eslint --print-config packages/jaeger-ui/src/components/App/Page.tsx` to dump the active rules for JS and TS files with and without the config loaded, then diffed them: ```diff --- ts-active-rules-cra.json 2023-03-10 21:24:37 +++ ts-active-rules-no-cra.json 2023-03-10 21:25:38 @@ -4,8 +4,7 @@ "jest": true, "jasmine": true, "es6": true, - "node": true, - "commonjs": true + "node": true }, "globals": { "__REACT_APP_GA_DEBUG__": false, @@ -27,7 +26,6 @@ "sourceType": "module" }, "plugins": [ - "flowtype", "import", "react", "jsx-a11y", @@ -2850,15 +2848,6 @@ ], "yoda": [ "error" - ], - "flowtype/define-flow-type": [ - "warn" - ], - "flowtype/require-valid-file-annotation": [ - "warn" - ], - "flowtype/use-flow-type": [ - "warn" ] }, "settings": { ``` ```diff --- js-active-rules-cra.json 2023-03-10 21:24:48 +++ js-active-rules-no-cra.json 2023-03-10 21:25:30 @@ -4,15 +4,14 @@ "jest": true, "jasmine": true, "es6": true, - "node": true, - "commonjs": true + "node": true }, "globals": { "__REACT_APP_GA_DEBUG__": false, "__REACT_APP_VSN_STATE__": false, "__APP_ENVIRONMENT__": false }, - "parser": "/REDACTED/jaeger-ui/node_modules/babel-eslint/lib/index.js", + "parser": null, "parserOptions": { "ecmaFeatures": { "jsx": true, @@ -23,7 +22,6 @@ "sourceType": "module" }, "plugins": [ - "flowtype", "import", "react", "jsx-a11y" @@ -2830,15 +2828,6 @@ ], "yoda": [ "error" - ], - "flowtype/define-flow-type": [ - "warn" - ], - "flowtype/require-valid-file-annotation": [ - "warn" - ], - "flowtype/use-flow-type": [ - "warn" ] }, "settings": { ``` So the only things added by the config is Flow support (which the project doesn't use), and extended ES6 support via `babel-eslint` (which is abandoned in favor of `@babel/eslint-parser`). As such, remove `eslint-plugin-flowtype` as well and replace `babel-eslint` with a simple `@babel/eslint-parser` config. --------- Signed-off-by: Máté Szabó <mszabo@fandom.com> Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
- Loading branch information
1 parent
397b335
commit 9075aa4
Showing
12 changed files
with
651 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.