-
-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lint): migrate to eslint flat config
- Loading branch information
Showing
16 changed files
with
1,333 additions
and
769 deletions.
There are no files selected for viewing
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,62 @@ | ||
import eslint from "@eslint/js"; | ||
import tseslint from 'typescript-eslint'; | ||
import reactPlugin from 'eslint-plugin-react'; | ||
import reactRefresh from "eslint-plugin-react-refresh"; | ||
import globals from "globals"; | ||
import eslintConfigPrettier from "eslint-config-prettier"; | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
tseslint.configs.recommended, | ||
// tseslint.configs.recommendedTypeChecked, // Add type checks. | ||
{ | ||
languageOptions: { | ||
globals: { | ||
...globals.serviceworker, | ||
...globals.browser, | ||
}, | ||
parserOptions: { | ||
projectService: true, | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.js'], | ||
extends: [tseslint.configs.disableTypeChecked], | ||
}, | ||
{ | ||
rules: { | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'@typescript-eslint/no-unused-expressions': 'off', | ||
'no-case-declarations': 'off', | ||
'no-prototype-builtins': 'off', | ||
}, | ||
}, | ||
reactPlugin.configs.flat.recommended, | ||
reactPlugin.configs.flat['jsx-runtime'], | ||
{ | ||
settings: { | ||
react: { | ||
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use | ||
}, | ||
}, | ||
rules: { | ||
'react/no-deprecated': 'warn', | ||
'react/prop-types': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['**/*.{jsx,tsx}'], | ||
plugins: { | ||
"react-refresh": reactRefresh, | ||
}, | ||
rules: { | ||
'react-refresh/only-export-components': 'warn', | ||
}, | ||
}, | ||
eslintConfigPrettier, // Avoid conflict with prettier. | ||
); |
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.