|
| 1 | +{ |
| 2 | + "root": true, |
| 3 | + "parser": "@typescript-eslint/parser", |
| 4 | + "plugins": ["@typescript-eslint", "import", "react", "react-hooks"], |
| 5 | + "extends": [ |
| 6 | + "eslint:recommended", |
| 7 | + "plugin:@typescript-eslint/recommended", |
| 8 | + "plugin:import/errors", |
| 9 | + "plugin:import/warnings", |
| 10 | + "plugin:react-hooks/recommended", |
| 11 | + "plugin:react/jsx-runtime" |
| 12 | + ], |
| 13 | + "parserOptions": { |
| 14 | + "ecmaVersion": "latest", |
| 15 | + "sourceType": "module", |
| 16 | + "ecmaFeatures": { |
| 17 | + "jsx": true |
| 18 | + } |
| 19 | + }, |
| 20 | + "rules": { |
| 21 | + "import/no-cycle": ["error", { "maxDepth": "∞" }], |
| 22 | + "import/no-unresolved": ["error", { "ignore": ["^@docusaurus/"] }], |
| 23 | + "no-restricted-syntax": [ |
| 24 | + "error", |
| 25 | + { |
| 26 | + "selector": "ImportDeclaration[source.value=/^\\./][source.value!=/\\.(js(on(c)?)?|(s)?css|svg|ico)$/]", |
| 27 | + "message": "Local imports must have the explicit extension" |
| 28 | + } |
| 29 | + ], |
| 30 | + "max-len": [ |
| 31 | + "error", |
| 32 | + { |
| 33 | + "code": 120, |
| 34 | + "ignoreComments": true, |
| 35 | + "ignoreTrailingComments": true, |
| 36 | + "ignoreUrls": true, |
| 37 | + "ignoreStrings": true, |
| 38 | + "ignoreTemplateLiterals": true, |
| 39 | + "ignoreRegExpLiterals": true |
| 40 | + } |
| 41 | + ], |
| 42 | + "eol-last": ["error", "always"], |
| 43 | + "eqeqeq": [2, "always"], |
| 44 | + "no-var": 2, |
| 45 | + "block-scoped-var": 2, |
| 46 | + "no-async-promise-executor": 2, |
| 47 | + "no-bitwise": [2, { "allow": ["~"] }], |
| 48 | + "no-duplicate-imports": [2, { "includeExports": true }], |
| 49 | + "no-eq-null": 2, |
| 50 | + "no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 0 }], |
| 51 | + "no-template-curly-in-string": 2, |
| 52 | + "no-unneeded-ternary": 2, |
| 53 | + "quote-props": [2, "as-needed"], |
| 54 | + "require-await": 2, |
| 55 | + "rest-spread-spacing": [2, "never"], |
| 56 | + "semi-spacing": 2, |
| 57 | + "space-before-function-paren": [ |
| 58 | + 2, |
| 59 | + { "anonymous": "always", "named": "never", "asyncArrow": "always" } |
| 60 | + ], |
| 61 | + "space-unary-ops": 2, |
| 62 | + "yoda": 2, |
| 63 | + "no-const-assign": 2, |
| 64 | + "no-extra-semi": 2, |
| 65 | + "for-direction": 2, |
| 66 | + "no-eval": 2, |
| 67 | + "indent": ["error", 2, { "offsetTernaryExpressions": true }], |
| 68 | + "no-empty": ["error", { "allowEmptyCatch": true }] |
| 69 | + }, |
| 70 | + "env": { |
| 71 | + "browser": true, |
| 72 | + "node": true |
| 73 | + }, |
| 74 | + "overrides": [ |
| 75 | + { |
| 76 | + "files": ["*.ts", "*.tsx"], |
| 77 | + "rules": { |
| 78 | + "@typescript-eslint/semi": ["error", "always"], |
| 79 | + "@typescript-eslint/quotes": [ |
| 80 | + "error", |
| 81 | + "single", |
| 82 | + { "avoidEscape": true, "allowTemplateLiterals": true } |
| 83 | + ], |
| 84 | + "@typescript-eslint/no-empty-function": [ |
| 85 | + "error", |
| 86 | + { "allow": ["arrowFunctions"] } |
| 87 | + ], |
| 88 | + "@typescript-eslint/indent": [ |
| 89 | + "error", |
| 90 | + 2, |
| 91 | + { "offsetTernaryExpressions": true } |
| 92 | + ] |
| 93 | + } |
| 94 | + }, |
| 95 | + { |
| 96 | + "files": ["*.js"], |
| 97 | + "parserOptions": { |
| 98 | + "project": null |
| 99 | + }, |
| 100 | + "rules": { |
| 101 | + "semi": ["error", "always"], |
| 102 | + "quotes": [ |
| 103 | + "error", |
| 104 | + "single", |
| 105 | + { "avoidEscape": true, "allowTemplateLiterals": true } |
| 106 | + ], |
| 107 | + "no-unused-vars": 2 |
| 108 | + } |
| 109 | + }, |
| 110 | + { |
| 111 | + "files": ["static/**/*"], |
| 112 | + "rules": { |
| 113 | + "import/no-unresolved": "off", |
| 114 | + "@typescript-eslint/no-var-requires": "off", |
| 115 | + "@typescript-eslint/no-unused-vars": "off", |
| 116 | + "no-unused-vars": "off", |
| 117 | + "no-bitwise": "off" |
| 118 | + } |
| 119 | + } |
| 120 | + ], |
| 121 | + "settings": { |
| 122 | + "import/resolver": { |
| 123 | + "typescript": { |
| 124 | + "alwaysTryTypes": true, |
| 125 | + "extensions": [".js", ".ts", "*.jsx", ".tsx"] |
| 126 | + } |
| 127 | + } |
| 128 | + } |
| 129 | +} |
0 commit comments