|
| 1 | +{ |
| 2 | + "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/eslintrc.json", |
| 3 | + |
| 4 | + "root": true, |
| 5 | + |
| 6 | + "env": { |
| 7 | + "node": true, |
| 8 | + "es2022": true |
| 9 | + }, |
| 10 | + |
| 11 | + "plugins": [ |
| 12 | + "@typescript-eslint", |
| 13 | + "import" |
| 14 | + ], |
| 15 | + |
| 16 | + "parser": "@typescript-eslint/parser", |
| 17 | + "parserOptions": { |
| 18 | + "ecmaVersion": 2022, |
| 19 | + "project": "tsconfig.json" |
| 20 | + }, |
| 21 | + |
| 22 | + "extends": [ |
| 23 | + "eslint:recommended", |
| 24 | + "plugin:@typescript-eslint/recommended", |
| 25 | + "plugin:@typescript-eslint/recommended-requiring-type-checking" |
| 26 | + ], |
| 27 | + |
| 28 | + "rules": { |
| 29 | + // ESLint |
| 30 | + |
| 31 | + // Possible Problems |
| 32 | + |
| 33 | + "no-constructor-return": ["error"], |
| 34 | + "no-duplicate-imports": ["error"], |
| 35 | + "no-new-native-nonconstructor": ["error"], |
| 36 | + "no-promise-executor-return": ["error"], |
| 37 | + "no-self-compare": ["error"], |
| 38 | + "no-template-curly-in-string": ["error"], |
| 39 | + "no-unmodified-loop-condition": ["error"], |
| 40 | + "no-unused-private-class-members": ["error"], |
| 41 | + "require-atomic-updates": ["error"], |
| 42 | + |
| 43 | + // Suggestions |
| 44 | + |
| 45 | + "arrow-body-style": ["error", "as-needed", { |
| 46 | + "requireReturnForObjectLiteral": true |
| 47 | + }], |
| 48 | + "eqeqeq": ["error", "always"], |
| 49 | + "func-style": ["error", "declaration", { |
| 50 | + "allowArrowFunctions": true |
| 51 | + }], |
| 52 | + "no-eval": ["error", { "allowIndirect": false }], |
| 53 | + "no-floating-decimal": ["error"], |
| 54 | + "no-implied-eval": ["error"], |
| 55 | + "no-multi-str": ["error"], |
| 56 | + "no-octal-escape": ["error"], |
| 57 | + "no-param-reassign": ["error"], |
| 58 | + "no-var": ["error"], |
| 59 | + "operator-assignment": ["error", "always"], |
| 60 | + "prefer-arrow-callback": ["error", { |
| 61 | + "allowNamedFunctions": false, |
| 62 | + "allowUnboundThis": true |
| 63 | + }], |
| 64 | + "prefer-const": ["error", { |
| 65 | + "destructuring": "any", |
| 66 | + "ignoreReadBeforeAssign": false |
| 67 | + }], |
| 68 | + "prefer-exponentiation-operator": ["error"], |
| 69 | + "prefer-named-capture-group": ["error"], |
| 70 | + "prefer-numeric-literals": ["error"], |
| 71 | + "prefer-regex-literals": ["error", { |
| 72 | + "disallowRedundantWrapping": true |
| 73 | + }], |
| 74 | + "prefer-rest-params": ["error"], |
| 75 | + "prefer-spread": ["error"], |
| 76 | + "prefer-template": ["error"], |
| 77 | + "quote-props": ["error", "as-needed", { |
| 78 | + "keywords": true, |
| 79 | + "unnecessary": true, |
| 80 | + "numbers": false |
| 81 | + }], |
| 82 | + "radix": ["error", "always"], |
| 83 | + |
| 84 | + // @typescript-eslint/eslint-plugin |
| 85 | + |
| 86 | + // ...tsEslintPlugin.configs["recommended"].rules, |
| 87 | + // ...tsEslintPlugin.configs["recommended-requiring-type-checking"].rules, |
| 88 | + |
| 89 | + "@typescript-eslint/explicit-member-accessibility": ["error", { |
| 90 | + "accessability": "explicit" |
| 91 | + }], |
| 92 | + "@typescript-eslint/member-delimiter-style": ["error", { |
| 93 | + "multiline": { |
| 94 | + "delimiter": "semi", |
| 95 | + "requireLast": true |
| 96 | + }, |
| 97 | + "singleline": { |
| 98 | + "delimiter": "semi", |
| 99 | + "requireLast": true |
| 100 | + } |
| 101 | + }], |
| 102 | + "@typescript-eslint/no-inferrable-types": ["off"], |
| 103 | + "@typescript-eslint/no-require-imports": ["error"], |
| 104 | + "@typescript-eslint/no-unsafe-declaration-merging": ["error"], |
| 105 | + "@typescript-eslint/no-unsafe-enum-comparison": ["error"], |
| 106 | + "@typescript-eslint/parameter-properties": ["error", { |
| 107 | + "prefer": "parameter-property" |
| 108 | + }], |
| 109 | + "@typescript-eslint/prefer-literal-enum-member": ["error"], |
| 110 | + "@typescript-eslint/prefer-optional-chain": ["error"], |
| 111 | + "@typescript-eslint/prefer-string-starts-ends-with": ["error"], |
| 112 | + "@typescript-eslint/prefer-ts-expect-error": ["error"], |
| 113 | + "@typescript-eslint/require-array-sort-compare": ["error", { |
| 114 | + "ignoreStringArrays": true |
| 115 | + }], |
| 116 | + |
| 117 | + // eslint-plugin-import |
| 118 | + |
| 119 | + // ...eslintPluginImport.configs.recommended, |
| 120 | + // ...eslintPluginImport.configs.typescript, |
| 121 | + |
| 122 | + // Helpful warnings |
| 123 | + |
| 124 | + "import/no-deprecated": ["error"], |
| 125 | + "import/no-empty-named-blocks": ["error"], |
| 126 | + |
| 127 | + // Module systems |
| 128 | + |
| 129 | + // Static analysis |
| 130 | + |
| 131 | + "import/no-absolute-path": ["error"], |
| 132 | + "import/no-self-import": ["error"], |
| 133 | + |
| 134 | + // Style guide |
| 135 | + |
| 136 | + "import/first": ["error"], |
| 137 | + "import/newline-after-import": ["error", { |
| 138 | + "considerComments": true |
| 139 | + }], |
| 140 | + "import/order": ["error", { |
| 141 | + "groups": [ |
| 142 | + ["builtin", "external"], |
| 143 | + "internal", |
| 144 | + ["parent", "sibling", "index"], |
| 145 | + "type", |
| 146 | + "object" |
| 147 | + ], |
| 148 | + "newlines-between": "always", |
| 149 | + "alphabetize": { |
| 150 | + "order": "asc", |
| 151 | + "orderImportKind": "asc", |
| 152 | + "caseInsensitive": false |
| 153 | + } |
| 154 | + }] |
| 155 | + } |
| 156 | +} |
0 commit comments