-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds back in support for react-hooks, prettier and testing-library eslint support * Unfortunately, react plugin is still generating v9 incompatible errors
- Loading branch information
1 parent
3f14d16
commit 44cd63c
Showing
15 changed files
with
126 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,118 @@ | ||
import jsPlugin from '@eslint/js' | ||
import tsPlugin from 'typescript-eslint' | ||
import importPlugin from 'eslint-plugin-import' | ||
import reactHooksPlugin from "eslint-plugin-react-hooks" | ||
import react from 'eslint-plugin-react' | ||
import configPrettier from 'eslint-config-prettier' | ||
|
||
// "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", | ||
"*.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/*", | ||
'*.js', | ||
'*.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-hooks": reactHooksPlugin, | ||
// Re-enable when react plugin is working correctly with eslint v9 | ||
// react, | ||
'react-hooks': fixupPluginRules({ | ||
rules: reactHooks.rules, | ||
}), | ||
'testing-library': fixupPluginRules({ | ||
rules: testingLibrary.rules, | ||
}), | ||
}, | ||
|
||
languageOptions: { | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
} | ||
}, | ||
|
||
rules: { | ||
semi: ["error", "never"], | ||
...testingLibrary.configs['flat/react'].rules, | ||
...reactHooks.configs.recommended.rules, | ||
|
||
// Re-enable when react plugin is working correctly with eslint v9 | ||
// 'react/jsx-uses-react': 'error', | ||
// 'react/jsx-uses-vars': 'error', | ||
|
||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-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/explicit-member-accessibility': [ | ||
'warn', | ||
{ | ||
accessibility: 'no-public', | ||
}, | ||
], | ||
|
||
"@typescript-eslint/no-empty-function": [ | ||
"error", { | ||
allow: ["constructors"], | ||
} | ||
'@typescript-eslint/no-empty-function': [ | ||
'error', | ||
{ | ||
allow: ['constructors'], | ||
}, | ||
], | ||
|
||
"@typescript-eslint/no-redeclare": "off", | ||
'@typescript-eslint/no-redeclare': 'off', | ||
|
||
"import/no-default-export": "error", | ||
"import/no-unresolved": "off", | ||
"import/named": "off", | ||
"import/first": "error", | ||
'import/no-default-export': 'error', | ||
'import/no-unresolved': 'off', | ||
'import/named': 'off', | ||
'import/first': 'error', | ||
|
||
"react/prop-types": "off", | ||
'react/prop-types': 'off', | ||
|
||
"no-console": "error", | ||
} | ||
} | ||
'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
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