eslint.config.mjs
import globals from 'globals';
import eslint from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
react.configs.flat.recommended,
tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2021,
...globals.node,
},
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
},
},
plugins: {
react: react,
'react-hooks': reactHooks,
'@typescript-eslint': tseslint.plugin,
},
rules: {
'no-undef': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
{
additionalHooks: 'useModernLayoutEffect',
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{
prefer: 'type-imports',
},
],
},
settings: {
react: {
version: '18',
},
},
},
{
files: ['packages/vue/**/*.{js,ts}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
);