|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +import * as globals from "globals"; |
| 4 | + |
| 5 | +import eslint from "@eslint/js"; |
| 6 | +import tseslint from "typescript-eslint"; |
| 7 | +import { flatConfigs as importPlugin } from "eslint-plugin-import"; |
| 8 | +import reactPlugin from "eslint-plugin-react"; |
| 9 | +import reactHooksPlugin from "eslint-plugin-react-hooks"; |
| 10 | +import jsxA11yPugin from "eslint-plugin-jsx-a11y"; |
| 11 | +import prettierPlugin from "eslint-plugin-prettier/recommended"; |
| 12 | + |
| 13 | +export default tseslint.config( |
| 14 | + { |
| 15 | + ignores: [ |
| 16 | + "**/.idea/", |
| 17 | + "**/.vscode/", |
| 18 | + "**/.docusaurus/", |
| 19 | + "**/node_modules/", |
| 20 | + "build/", |
| 21 | + ], |
| 22 | + }, |
| 23 | + { |
| 24 | + extends: [ |
| 25 | + eslint.configs.recommended, |
| 26 | + ...tseslint.configs.recommendedTypeChecked, |
| 27 | + importPlugin.recommended, |
| 28 | + reactPlugin.configs.flat?.recommended, |
| 29 | + reactPlugin.configs.flat?.["jsx-runtime"], |
| 30 | + { |
| 31 | + plugins: { "react-hooks": reactHooksPlugin }, |
| 32 | + rules: { ...reactHooksPlugin.configs.recommended.rules }, |
| 33 | + }, |
| 34 | + jsxA11yPugin.flatConfigs.recommended, |
| 35 | + prettierPlugin, |
| 36 | + ], |
| 37 | + |
| 38 | + languageOptions: { |
| 39 | + ...reactPlugin.configs.flat?.recommended.languageOptions, |
| 40 | + |
| 41 | + globals: { |
| 42 | + ...globals.browser, |
| 43 | + ...globals.node, |
| 44 | + window: true, |
| 45 | + }, |
| 46 | + |
| 47 | + ecmaVersion: 5, |
| 48 | + sourceType: "commonjs", |
| 49 | + |
| 50 | + parserOptions: { |
| 51 | + // projectService: true, |
| 52 | + projectService: { |
| 53 | + // allowDefaultProject: ["eslint.config.mjs"], |
| 54 | + defaultProject: "tsconfig.json", |
| 55 | + }, |
| 56 | + tsconfigRootDir: import.meta.dirname, |
| 57 | + }, |
| 58 | + }, |
| 59 | + |
| 60 | + settings: { |
| 61 | + react: { |
| 62 | + version: "detect", |
| 63 | + }, |
| 64 | + |
| 65 | + "import/extensions": [".ts", ".tsx"], |
| 66 | + |
| 67 | + "import/resolver": { |
| 68 | + node: { |
| 69 | + paths: ["front"], |
| 70 | + }, |
| 71 | + }, |
| 72 | + }, |
| 73 | + |
| 74 | + rules: { |
| 75 | + "react/jsx-uses-react": 2, |
| 76 | + "@typescript-eslint/no-unused-vars": 2, |
| 77 | + |
| 78 | + // TODO Need to fix the errors in project and delete all the rows below |
| 79 | + // basic |
| 80 | + "no-async-promise-executor": 0, |
| 81 | + "import/no-unresolved": 0, |
| 82 | + |
| 83 | + // react |
| 84 | + "react/prop-types": 0, |
| 85 | + "react/no-find-dom-node": 0, |
| 86 | + "react/no-unescaped-entities": 0, |
| 87 | + "react-hooks/exhaustive-deps": 0, |
| 88 | + |
| 89 | + // ts |
| 90 | + "@typescript-eslint/no-unsafe-member-access": 0, |
| 91 | + "@typescript-eslint/no-unsafe-assignment": 0, |
| 92 | + "@typescript-eslint/no-unsafe-call": 0, |
| 93 | + "@typescript-eslint/no-unsafe-argument": 0, |
| 94 | + "@typescript-eslint/no-unsafe-return": 0, |
| 95 | + "@typescript-eslint/no-explicit-any": 0, |
| 96 | + "@typescript-eslint/restrict-template-expressions": 0, |
| 97 | + "@typescript-eslint/restrict-plus-operands": 0, |
| 98 | + "@typescript-eslint/no-floating-promises": 0, |
| 99 | + "@typescript-eslint/no-misused-promises": 0, |
| 100 | + "@typescript-eslint/no-empty-interface": 0, |
| 101 | + |
| 102 | + // a11y |
| 103 | + "jsx-a11y/click-events-have-key-events": 0, |
| 104 | + "jsx-a11y/no-static-element-interactions": 0, |
| 105 | + "jsx-a11y/img-redundant-alt": 0, |
| 106 | + "jsx-a11y/alt-text": 0, |
| 107 | + "jsx-a11y/interactive-supports-focus": 0, |
| 108 | + }, |
| 109 | + }, |
| 110 | +); |
0 commit comments