-
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.
feat: migrate to ESLint v9 flat config
- Loading branch information
1 parent
c444cc6
commit 4179cd8
Showing
6 changed files
with
448 additions
and
364 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@tokens-studio/configs': minor | ||
--- | ||
|
||
Migrate to ESLint v9 which uses flat config and makes it easier to extend/share configs. |
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
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,66 @@ | ||
const js = require('@eslint/js'); | ||
const hooks = require('eslint-plugin-react-hooks'); | ||
const react = require('eslint-plugin-react'); | ||
const tseslint = require('typescript-eslint'); | ||
const globals = require('globals'); | ||
|
||
module.exports = tseslint.config( | ||
js.configs.recommended, | ||
...tseslint.configs.recommended, | ||
react.configs.flat.recommended, | ||
react.configs.flat['jsx-runtime'], | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
plugins: { | ||
'react-hooks': hooks, | ||
}, | ||
rules: { | ||
...hooks.configs.recommended.rules, | ||
'no-console': ['error', { allow: ['warn', 'error'] }], | ||
'react/react-in-jsx-scope': 'off', | ||
'react/jsx-key': 'off', | ||
'@typescript-eslint/no-explicit-any': 1, | ||
'import/no-anonymous-default-export': 'off', | ||
'@typescript-eslint/no-unused-vars': 1, | ||
'@typescript-eslint/ban-ts-comment': [ | ||
2, | ||
{ | ||
'ts-check': false, | ||
'ts-ignore': true, | ||
'ts-nocheck': 'allow-with-description', | ||
'ts-expect-error': 'allow-with-description', | ||
}, | ||
], | ||
'@typescript-eslint/no-require-imports': [ | ||
2, | ||
{ | ||
allow: ['\\.cjs$'], | ||
}, | ||
], | ||
'sort-imports': 'error', | ||
// Should be used with known heuristics like knowing that a property is non optional in GraphQL for example | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'react/jsx-curly-spacing': ['error', 'never'], | ||
|
||
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off', | ||
// Causes issues with prettier | ||
indent: 'off', | ||
'react/jsx-indent-props': 'off', | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['*.cjs'], | ||
rules: { | ||
'@typescript-eslint/no-require-imports': 0, | ||
}, | ||
}, | ||
); |
Oops, something went wrong.