import { defineConfig, globalIgnores } from "eslint/config"; import react from "eslint-plugin-react"; import prettier from "eslint-plugin-prettier"; import { configs } from "@eslint/js"; import { FlatCompat } from "@eslint/eslintrc"; const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: configs.recommended, allConfig: configs.all }); export default defineConfig([ { extends: compat.extends( "@com.mgmtp.a12.devtools/eslint-config/eslint-config-react", "prettier", "plugin:deprecation/recommended" ), languageOptions: { parserOptions: { project: "tsconfig.json" } }, plugins: { react, prettier }, rules: { "deprecation/deprecation": "error", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-non-null-assertion": "off", "no-inner-declarations": "off", "arrow-parens": "error", "no-console": "error", "no-unused-expressions": "error", "object-shorthand": "error", "react/prefer-read-only-props": "error", "react/jsx-sort-props": "error", "react/function-component-definition": [ "error", { namedComponents: "function-declaration" } ], semi: "error", "@typescript-eslint/no-unused-vars": [ "error", { args: "after-used", argsIgnorePattern: "^_", caughtErrors: "none", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", varsIgnorePattern: "^_", ignoreRestSiblings: true } ], "react-hooks/exhaustive-deps": "off", "import/order": ["off"], "prettier/prettier": [ "warn", { endOfLine: "auto" } ] }, settings: { react: { version: "detect" } } }, globalIgnores([ "**/.*rc.js", "**/*config.js", "**/*config.ts", "**/dist", "**/generated", "**/scripts", "**/webpack*.js", "**/node_modules", "**/playwright-report" ]), { files: ["**/*.test.{ts,tsx}"], rules: { "no-unused-expressions": "off" } }, { files: ["tests/e2e/**"], extends: compat.extends("prettier", "plugin:playwright/recommended"), rules: { "playwright/no-conditional-in-test": "off", "playwright/no-nested-step": "off", "playwright/valid-expect": [ "error", { minArgs: 2 } ] } } ]);