Fix ESLint config - bypass FlatCompat circular reference bug
- Remove FlatCompat wrapper that caused circular structure error - Use typescript-eslint directly with react-hooks plugin - Add eslint-plugin-react-hooks dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
92092760a7
commit
86fe36b544
|
|
@ -1,16 +1,27 @@
|
||||||
import { dirname } from "path";
|
import tseslint from 'typescript-eslint';
|
||||||
import { fileURLToPath } from "url";
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||||||
import { FlatCompat } from "@eslint/eslintrc";
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
export default tseslint.config(
|
||||||
const __dirname = dirname(__filename);
|
{
|
||||||
|
ignores: [
|
||||||
const compat = new FlatCompat({
|
'node_modules/**',
|
||||||
baseDirectory: __dirname,
|
'.next/**',
|
||||||
});
|
'out/**',
|
||||||
|
'dist/**',
|
||||||
const eslintConfig = [
|
'build/**',
|
||||||
...compat.extends("next/core-web-vitals"),
|
],
|
||||||
];
|
},
|
||||||
|
...tseslint.configs.recommended,
|
||||||
export default eslintConfig;
|
{
|
||||||
|
plugins: {
|
||||||
|
'react-hooks': reactHooks,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'react-hooks/rules-of-hooks': 'error',
|
||||||
|
'react-hooks/exhaustive-deps': 'warn',
|
||||||
|
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||||
|
'@typescript-eslint/no-explicit-any': 'warn',
|
||||||
|
'@typescript-eslint/no-require-imports': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -72,8 +72,9 @@
|
||||||
"@types/react-dom": "^19.0.2",
|
"@types/react-dom": "^19.0.2",
|
||||||
"@vitejs/plugin-react": "^5.1.2",
|
"@vitejs/plugin-react": "^5.1.2",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"eslint": "^9.17.0",
|
"eslint": "^9.39.2",
|
||||||
"eslint-config-next": "16.1.1",
|
"eslint-config-next": "16.1.1",
|
||||||
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
"jsdom": "^27.0.1",
|
"jsdom": "^27.0.1",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"prettier": "^3.4.2",
|
"prettier": "^3.4.2",
|
||||||
|
|
@ -81,6 +82,7 @@
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"tsx": "^4.19.2",
|
"tsx": "^4.19.2",
|
||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
|
"typescript-eslint": "^8.53.0",
|
||||||
"vitest": "^4.0.16",
|
"vitest": "^4.0.16",
|
||||||
"vitest-mock-extended": "^3.1.0"
|
"vitest-mock-extended": "^3.1.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue