51 lines
1.8 KiB
JavaScript
51 lines
1.8 KiB
JavaScript
import js from "@eslint/js";
|
|
import globals from "globals";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ["dist", "backend/dist", "coverage", "playwright-report", "test-results"] },
|
|
{
|
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2020,
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
// React Hooks 7 adds React Compiler diagnostics to its recommended set.
|
|
// This app is not compiler-enabled yet; keep those migration diagnostics
|
|
// outside the release gate while retaining the upgraded hooks correctness rules.
|
|
"react-hooks/preserve-manual-memoization": "off",
|
|
"react-hooks/purity": "off",
|
|
"react-hooks/set-state-in-effect": "off",
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
// The legacy baseline contains tracked dead declarations. Keep this out of
|
|
// the v1 gate until they can be removed in behavior-preserving slices.
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"no-restricted-imports": [
|
|
"error",
|
|
{ patterns: [{ group: ["@/shared/components/ui", "@/shared/components/ui/*", "@/shared/components/layout/AppLayout"], message: "Use the canonical @/components UI and layout paths." }] },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
"src/components/ui/**/*.{ts,tsx}",
|
|
"src/**/contexts/**/*.{ts,tsx}",
|
|
],
|
|
rules: {
|
|
"react-refresh/only-export-components": "off",
|
|
},
|
|
},
|
|
);
|