-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Upgrades eslint to v9 and migrate to flat config #870
* Conversion of .eslintrc.js to eslint.config.mjs * Incorporation of .eslintignore into config file * Upgrades eslint package and respective plugins * eslint.config.mjs * Some plugins are still not eslint 9 compatible so the compat library is used as a go-between * [*.ts, *.js] * Updates to satisfy new warnings produced by running `yarn lint`
- Loading branch information
1 parent
caec81e
commit 1f58ebc
Showing
18 changed files
with
2,815 additions
and
526 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 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,119 @@ | ||
import jsPlugin from '@eslint/js' | ||
import tsPlugin from 'typescript-eslint' | ||
import importPlugin from 'eslint-plugin-import' | ||
import react from 'eslint-plugin-react' | ||
import configPrettier from 'eslint-config-prettier' | ||
|
||
// Plugins still requiring compat library as not yet fully v9 flat-config compliant | ||
import { fixupPluginRules } from '@eslint/compat' | ||
import reactHooks from 'eslint-plugin-react-hooks' | ||
import testingLibrary from 'eslint-plugin-testing-library' | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
'*.js', | ||
'!/packages/hawtio/scripts/*.js', | ||
'*.cjs', | ||
'/app/*.js', | ||
'/app/*.cjs', | ||
'*.mjs', | ||
'**/.jestEnvVars.js', | ||
'.gitignore', | ||
'.dockerignore', | ||
'**/.env.*', | ||
'**/env.*', | ||
'**/ignore/**/*', | ||
'**/__mocks__/*.js', | ||
'**/testdata/**/*.js', | ||
'**/jest.config.ts', | ||
'**/tsup.config*.ts', | ||
'**/webpack*.js', | ||
'**/proxy-dev-server.js', | ||
'**/dist/*', | ||
'**/build/*', | ||
], | ||
}, | ||
|
||
configPrettier, | ||
jsPlugin.configs.recommended, | ||
...tsPlugin.configs.recommended, | ||
importPlugin.flatConfigs.recommended, | ||
|
||
{ | ||
plugins: { | ||
react, | ||
'react-hooks': fixupPluginRules({ | ||
rules: reactHooks.rules, | ||
}), | ||
'testing-library': fixupPluginRules({ | ||
rules: testingLibrary.rules, | ||
}), | ||
}, | ||
|
||
languageOptions: { | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
|
||
rules: { | ||
...testingLibrary.configs['flat/react'].rules, | ||
...reactHooks.configs.recommended.rules, | ||
|
||
'react/jsx-uses-react': 'error', | ||
'react/jsx-uses-vars': 'error', | ||
|
||
semi: ['error', 'never'], | ||
|
||
'no-undef': 'off', | ||
'no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
args: 'none', | ||
argsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
|
||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'warn', | ||
{ | ||
accessibility: 'no-public', | ||
}, | ||
], | ||
|
||
'@typescript-eslint/no-empty-function': [ | ||
'error', | ||
{ | ||
allow: ['constructors'], | ||
}, | ||
], | ||
|
||
'@typescript-eslint/no-redeclare': 'off', | ||
|
||
'import/no-default-export': 'error', | ||
'import/no-unresolved': 'off', | ||
'import/named': 'off', | ||
'import/first': 'error', | ||
|
||
'react/prop-types': 'off', | ||
|
||
'no-template-curly-in-string': 'error', | ||
'no-console': 'error', | ||
|
||
'testing-library/await-async-queries': 'off', | ||
'testing-library/no-debugging-utils': [ | ||
'warn', | ||
{ | ||
utilsToCheckFor: { | ||
debug: false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
] |
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
13 changes: 10 additions & 3 deletions
13
packages/hawtio/src/plugins/camel/exchanges/BlockedExchanges.tsx
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
3 changes: 2 additions & 1 deletion
3
packages/hawtio/src/plugins/camel/route-diagram/RouteDiagram.tsx
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.