Fix ESLint config - bypass FlatCompat circular reference bug
Build and Push Docker Image / lint-and-typecheck (push) Failing after 1m26s Details
Build and Push Docker Image / build (push) Has been skipped Details

- 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:
Matt 2026-01-17 12:39:59 +01:00
parent 92092760a7
commit 86fe36b544
3 changed files with 825 additions and 842 deletions

View File

@ -1,16 +1,27 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import tseslint from 'typescript-eslint';
import reactHooks from 'eslint-plugin-react-hooks';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
});
const eslintConfig = [
...compat.extends("next/core-web-vitals"),
];
export default eslintConfig;
export default tseslint.config(
{
ignores: [
'node_modules/**',
'.next/**',
'out/**',
'dist/**',
'build/**',
],
},
...tseslint.configs.recommended,
{
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',
},
},
);

1622
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -72,8 +72,9 @@
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^5.1.2",
"autoprefixer": "^10.4.20",
"eslint": "^9.17.0",
"eslint": "^9.39.2",
"eslint-config-next": "16.1.1",
"eslint-plugin-react-hooks": "^7.0.1",
"jsdom": "^27.0.1",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
@ -81,6 +82,7 @@
"tailwindcss": "^3.4.17",
"tsx": "^4.19.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.53.0",
"vitest": "^4.0.16",
"vitest-mock-extended": "^3.1.0"
}