-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DATAP-1619 Upgraded to ESLint v9 for CCDB UI (#572)
* Initial upgrades and updates to config rules * updated with cypress-related config * converted main eslint config file to '.mjs' to distinguished it as a module, as opposed to making all js files modules by default in the package.json file * removed outdated comment per PR feedback * added eslint plugins for react-hooks and react-redux * Build updates * update dist * update dist --------- Co-authored-by: Chanel Henley <[email protected]> Co-authored-by: Richard Dinh <[email protected]>
- Loading branch information
1 parent
2c89b14
commit cdab141
Showing
62 changed files
with
973 additions
and
777 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Run `npx @eslint/config-inspector` to inspect the config. | ||
|
||
import globals from 'globals'; | ||
import js from '@eslint/js'; | ||
import importPlugin from 'eslint-plugin-import'; | ||
import jsdoc from 'eslint-plugin-jsdoc'; | ||
import jsxA11y from 'eslint-plugin-jsx-a11y'; | ||
import reactPlugin from 'eslint-plugin-react'; | ||
import reactHooksPlugin from 'eslint-plugin-react-hooks'; | ||
import reactReduxPlugin from 'eslint-plugin-react-redux'; | ||
import pluginCypress from 'eslint-plugin-cypress/flat'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import babelParser from '@babel/eslint-parser'; | ||
|
||
export default [ | ||
{ | ||
ignores: ['\*_/**fixtures**/_.js', 'serviceWorker.js'] | ||
}, | ||
js.configs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
jsdoc.configs['flat/recommended'], | ||
jsxA11y.flatConfigs.recommended, | ||
reactPlugin.configs.flat.recommended, | ||
pluginCypress.configs.recommended, | ||
eslintConfigPrettier, | ||
{ | ||
plugins: { | ||
'react-hooks': reactHooksPlugin, | ||
'react-redux': reactReduxPlugin | ||
} | ||
}, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: 2023, | ||
parser: babelParser, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
globals: { | ||
...globals.browser, | ||
...globals.node, | ||
...globals.jest, | ||
}, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
paths: ['src'], | ||
extensions: ['.js', '.jsx', '.ts', '.d.ts', '.tsx'] | ||
}, | ||
}, | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
rules: { | ||
'id-length': ['error', { min: 2 }], | ||
'jsdoc/require-hyphen-before-param-description': ['warn', 'always'], | ||
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }], | ||
'no-console': ['warn'], | ||
'no-use-before-define': ['error','nofunc'], | ||
'no-unused-vars': [ | ||
'error', | ||
{ | ||
vars: 'all', | ||
args: 'after-used', | ||
ignoreRestSiblings: false, | ||
}, | ||
], | ||
'no-var': ['error'], | ||
'prefer-const': ['error'], | ||
radix: ['error'], | ||
'react/jsx-no-leaked-render': [ | ||
'error', | ||
{ validStrategies: ['coerce', 'ternary'] }, | ||
], | ||
'react/no-multi-comp': ['error', { ignoreStateless: true }], | ||
'react/no-unstable-nested-components': ['error'], | ||
'react/self-closing-comp': ['error'], | ||
'react/boolean-prop-naming': ['error', { validateNested: true }], | ||
'react/default-props-match-prop-types': [ | ||
'error', | ||
{ allowRequiredDefaults: true }, | ||
], | ||
'react/jsx-curly-brace-presence': ['error'], | ||
'react/jsx-uses-react': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
...reactHooksPlugin.configs.recommended.rules, | ||
...reactReduxPlugin.configs.recommended.rules | ||
}, | ||
}, | ||
]; |
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
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.