|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2021: true, |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + "plugin:react/recommended", |
| 8 | + "airbnb-typescript", |
| 9 | + "plugin:import/typescript", |
| 10 | + // @NOTE: Make sure this is always the last element in the array. |
| 11 | + "plugin:prettier/recommended", |
| 12 | + ], |
| 13 | + parser: "@typescript-eslint/parser", |
| 14 | + parserOptions: { |
| 15 | + ecmaVersion: 2020, |
| 16 | + sourceType: "module", |
| 17 | + ecmaFeatures: { |
| 18 | + jsx: true, |
| 19 | + }, |
| 20 | + project: ["./tsconfig.json"], |
| 21 | + }, |
| 22 | + plugins: [ |
| 23 | + "react", |
| 24 | + "react-hooks", |
| 25 | + "jsx-a11y", |
| 26 | + "import", |
| 27 | + "prettier", |
| 28 | + "@typescript-eslint", |
| 29 | + ], |
| 30 | + settings: { |
| 31 | + react: { |
| 32 | + pragma: "React", // Pragma to use, default to "React" |
| 33 | + fragment: "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment" |
| 34 | + version: "detect", // React version. "detect" automatically picks the version you have installed. |
| 35 | + // You can also use `16.0`, `16.3`, etc, if you want to override the detected value. |
| 36 | + // default to latest and warns if missing |
| 37 | + // It will default to "detect" in the future |
| 38 | + }, |
| 39 | + "import/parsers": { |
| 40 | + "@typescript-eslint/parser": [".ts", ".tsx"], |
| 41 | + }, |
| 42 | + "import/resolver": { |
| 43 | + typescript: {}, |
| 44 | + }, |
| 45 | + }, |
| 46 | + rules: { |
| 47 | + "import/prefer-default-export": 0, |
| 48 | + "react/prop-types": 0, |
| 49 | + "import/no-unresolved": [ |
| 50 | + "error", |
| 51 | + { ignore: ["^@theme", "^@docusaurus", "^@site"] }, |
| 52 | + ], |
| 53 | + "no-nested-ternary": 0, |
| 54 | + "no-console": 0, |
| 55 | + "no-unused-vars": 0, |
| 56 | + "no-use-before-define": 0, |
| 57 | + "arrow-body-style": 0, |
| 58 | + "jsx-a11y/anchor-is-valid": 0, |
| 59 | + "jsx-a11y/no-static-element-interactions": 0, |
| 60 | + "jsx-a11y/click-events-have-key-events": 0, |
| 61 | + "@typescript-eslint/no-unused-expressions": 0, |
| 62 | + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], |
| 63 | + "@typescript-eslint/no-use-before-define": "warn", |
| 64 | + "react/require-default-props": 0, |
| 65 | + "react/jsx-props-no-spreading": 0, |
| 66 | + "react/button-has-type": 0, |
| 67 | + "jsx-a11y/label-has-associated-control": [ |
| 68 | + "error", |
| 69 | + { |
| 70 | + labelComponents: [], |
| 71 | + labelAttributes: [], |
| 72 | + controlComponents: [], |
| 73 | + assert: "either", |
| 74 | + depth: 2, |
| 75 | + }, |
| 76 | + ], |
| 77 | + "@typescript-eslint/naming-convention": [ |
| 78 | + "error", |
| 79 | + { |
| 80 | + selector: "variableLike", |
| 81 | + leadingUnderscore: "forbid", |
| 82 | + trailingUnderscore: "forbid", |
| 83 | + format: ["camelCase", "PascalCase", "UPPER_CASE"], |
| 84 | + }, |
| 85 | + ], |
| 86 | + "import/extensions": 0, |
| 87 | + }, |
| 88 | +}; |
0 commit comments