Upgrade to ESLint 9

This commit is contained in:
Alex
2024-10-16 00:29:26 -04:00
parent 0138cabb27
commit 00d0dfa107
53 changed files with 3813 additions and 2207 deletions

View File

@ -4,23 +4,30 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import type { Linter } from 'eslint';
import RulesOfHooks from './RulesOfHooks';
import { Linter } from 'eslint';
import ExhaustiveDeps from './ExhaustiveDeps';
import { name, version } from './package.json';
import RulesOfHooks from './RulesOfHooks';
export const __EXPERIMENTAL__ = false;
export const configs = {
export const flatConfigs = {
recommended: {
plugins: ['react-hooks'],
name: 'react-hooks/recommended',
plugins: {
'react-hooks': {
meta: { name, version },
rules: {
'rules-of-hooks': RulesOfHooks,
'exhaustive-deps': ExhaustiveDeps,
},
},
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
} as Linter.BaseConfig,
};
export const rules = {
'rules-of-hooks': RulesOfHooks,
'exhaustive-deps': ExhaustiveDeps,
} satisfies Linter.Config,
};