-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init eslint config * fix common problems and remove rules requiring React to be in scope (we're React version > 17) * relax use of explicit any for eslint for migration purposes * fix additional miscelaneous errors * add prettier and jsxA11y eslint plugins to our new config * remove old eslint configs from package.json * remove old unused dev dependencies include ts-jest (we don't use jest anymore) * migrate vitest to version > 2 * enable strict and stylistic typescript-eslint configs
- Loading branch information
1 parent
810e59c
commit 1990dc0
Showing
81 changed files
with
1,485 additions
and
4,300 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
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 |
---|---|---|
|
@@ -18,3 +18,5 @@ npm-debug.log* | |
yarn-debug.log* | ||
yarn-error.log* | ||
tsconfig.tsbuildinfo | ||
.next | ||
next-env.d.ts |
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 reactPlugin from 'eslint-plugin-react'; // https://github.com/jsx-eslint/eslint-plugin-react?tab=readme-ov-file#configuration | ||
import globals from 'globals'; | ||
import pluginJs from '@eslint/js'; | ||
import tsEslint from 'typescript-eslint'; | ||
import jsxA11y from 'eslint-plugin-jsx-a11y'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
|
||
export default [ | ||
// ToDo: eslint-plugin-react-hooks does not yet support eslint > 9 and this config | ||
pluginJs.configs.recommended, | ||
jsxA11y.flatConfigs.recommended, | ||
// ...tseslint.configs.recommended, // recommended config is overridden by strict/stylistic | ||
...tsEslint.configs.strict, | ||
...tsEslint.configs.stylistic, | ||
eslintPluginPrettierRecommended, | ||
{ | ||
name: 'ignore-outputs', | ||
ignores: ['**/build/', '**/dist/', '**/node_modules/', '**/.next/'], | ||
}, | ||
{ | ||
name: 'react', | ||
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'], | ||
...reactPlugin.configs.flat.recommended, | ||
languageOptions: { | ||
...reactPlugin.configs.flat.recommended.languageOptions, | ||
globals: globals.browser, | ||
parserOptions: { | ||
ecmaFeatures: { jsx: true }, | ||
}, | ||
}, | ||
rules: { | ||
'react/react-in-jsx-scope': 0, | ||
'react/jsx-uses-react': 0, | ||
}, | ||
}, | ||
{ | ||
name: 'ts-migration-relax', | ||
files: ['**/*.{ts,tsx}'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'warn', | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
}, | ||
}, | ||
{ | ||
name: 'ts-unused-vars', | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
args: 'all', | ||
argsIgnorePattern: '^_', | ||
caughtErrors: 'all', | ||
caughtErrorsIgnorePattern: '^_', | ||
destructuredArrayIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
// ignoreRestSiblings: true, - if you want to ignore unused rest siblings | ||
}, | ||
], | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.