|
4 | 4 | "plugins": ["@typescript-eslint", "prettier"], |
5 | 5 | "extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended", "prettier"], |
6 | 6 | "rules": { |
7 | | - "max-len": "off", |
8 | | - "sort-imports": [ |
9 | | - "off", |
10 | | - { |
11 | | - "allowSeparatedGroups": true |
12 | | - } |
13 | | - ], |
14 | | - "sort-keys": "off", |
15 | 7 | "no-useless-catch": "off", //TODO- Remove the unnecessary try-catch lines used and enable no-useless-catch rule. |
16 | | - "no-constant-condition": "off", |
17 | | - "no-empty-interface": "off", |
18 | 8 | "prefer-rest-params": "off", |
| 9 | + "no-constant-condition": "off", |
| 10 | + // @typescript-eslint rules |
19 | 11 | "@typescript-eslint/no-empty-interface": "off", |
20 | 12 | "@typescript-eslint/ban-types": "off", |
21 | | - "no-mixed-spaces-and-tabs": "off", |
22 | | - "@typescript-eslint/no-unused-vars": "off", |
| 13 | + "@typescript-eslint/no-unused-vars": "error", |
23 | 14 | "@typescript-eslint/no-explicit-any": "off", |
24 | 15 | "@typescript-eslint/explicit-module-boundary-types": "off", |
25 | | - "prettier/prettier": "error" |
| 16 | + "prettier/prettier": "error", |
| 17 | + "@typescript-eslint/no-var-requires": "error", |
| 18 | + "@typescript-eslint/no-non-null-assertion": "error", |
| 19 | + "@typescript-eslint/naming-convention": [ |
| 20 | + "error", |
| 21 | + { |
| 22 | + "selector": "typeLike", |
| 23 | + "format": ["PascalCase"], |
| 24 | + "filter": { |
| 25 | + "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", |
| 26 | + "match": false |
| 27 | + } |
| 28 | + }, |
| 29 | + { |
| 30 | + "selector": "interface", |
| 31 | + "format": ["PascalCase"], |
| 32 | + "custom": { |
| 33 | + "regex": "^I[A-Z]", |
| 34 | + "match": false |
| 35 | + }, |
| 36 | + "filter": { |
| 37 | + "regex": "^I(Arguments|TextWriter|O([A-Z][a-z]+[A-Za-z]*)?)$", |
| 38 | + "match": false |
| 39 | + } |
| 40 | + }, |
| 41 | + { |
| 42 | + "selector": "variable", |
| 43 | + "format": ["camelCase", "PascalCase", "UPPER_CASE"], |
| 44 | + "leadingUnderscore": "allow", |
| 45 | + "filter": { |
| 46 | + "regex": "^(_{1,2}filename|_{1,2}dirname|_+|[A-Za-z]+_[A-Za-z]+)$", |
| 47 | + "match": false |
| 48 | + } |
| 49 | + }, |
| 50 | + { |
| 51 | + "selector": "function", |
| 52 | + "format": ["camelCase", "PascalCase"], |
| 53 | + "leadingUnderscore": "allow", |
| 54 | + "filter": { |
| 55 | + "regex": "^[A-Za-z]+_[A-Za-z]+$", |
| 56 | + "match": false |
| 57 | + } |
| 58 | + }, |
| 59 | + { |
| 60 | + "selector": "parameter", |
| 61 | + "format": ["camelCase"], |
| 62 | + "leadingUnderscore": "allow", |
| 63 | + "filter": { |
| 64 | + "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", |
| 65 | + "match": false |
| 66 | + } |
| 67 | + }, |
| 68 | + { |
| 69 | + "selector": "method", |
| 70 | + "format": ["camelCase", "PascalCase"], |
| 71 | + "leadingUnderscore": "allow", |
| 72 | + "filter": { |
| 73 | + "regex": "^[A-Za-z]+_[A-Za-z]+$", |
| 74 | + "match": false |
| 75 | + } |
| 76 | + }, |
| 77 | + { |
| 78 | + "selector": "memberLike", |
| 79 | + "format": ["camelCase"], |
| 80 | + "leadingUnderscore": "allow", |
| 81 | + "filter": { |
| 82 | + "regex": "^[A-Za-z]+_[A-Za-z]+$", |
| 83 | + "match": false |
| 84 | + } |
| 85 | + }, |
| 86 | + { |
| 87 | + "selector": "enumMember", |
| 88 | + "format": ["camelCase", "PascalCase"], |
| 89 | + "leadingUnderscore": "allow", |
| 90 | + "filter": { |
| 91 | + "regex": "^[A-Za-z]+_[A-Za-z]+$", |
| 92 | + "match": false |
| 93 | + } |
| 94 | + }, |
| 95 | + { |
| 96 | + "selector": "property", |
| 97 | + "format": null |
| 98 | + } |
| 99 | + ], |
| 100 | + "@typescript-eslint/semi": "error", |
| 101 | + "@typescript-eslint/no-use-before-define": "off", |
| 102 | + "@typescript-eslint/prefer-for-of": "error", |
| 103 | + "@typescript-eslint/prefer-function-type": "error", |
| 104 | + "@typescript-eslint/prefer-namespace-keyword": "error", |
| 105 | + "@typescript-eslint/quotes": [ |
| 106 | + "error", |
| 107 | + "double", |
| 108 | + { |
| 109 | + "avoidEscape": true, |
| 110 | + "allowTemplateLiterals": true |
| 111 | + } |
| 112 | + ], |
| 113 | + "@typescript-eslint/space-within-parens": ["off", "never"], |
| 114 | + "@typescript-eslint/triple-slash-reference": "error", |
| 115 | + "@typescript-eslint/type-annotation-spacing": "error", |
| 116 | + "@typescript-eslint/unified-signatures": "error", |
| 117 | + "@typescript-eslint/adjacent-overload-signatures": "error", |
| 118 | + "@typescript-eslint/array-type": "error", |
| 119 | + "@typescript-eslint/consistent-type-definitions": ["error", "interface"], |
| 120 | + "@typescript-eslint/no-inferrable-types": "error", |
| 121 | + "@typescript-eslint/no-misused-new": "error", |
| 122 | + "@typescript-eslint/no-this-alias": "error", |
| 123 | + "no-unused-expressions": "off", |
| 124 | + "@typescript-eslint/no-unused-expressions": [ |
| 125 | + "error", |
| 126 | + { |
| 127 | + "allowTernary": true |
| 128 | + } |
| 129 | + ], |
| 130 | + "@typescript-eslint/space-before-function-paren": [ |
| 131 | + "error", |
| 132 | + { |
| 133 | + "asyncArrow": "always", |
| 134 | + "anonymous": "never", |
| 135 | + "named": "never" |
| 136 | + } |
| 137 | + ], |
| 138 | + "@typescript-eslint/consistent-type-assertions": "error", |
| 139 | + "@typescript-eslint/explicit-member-accessibility": [ |
| 140 | + "off", |
| 141 | + { |
| 142 | + "accessibility": "explicit" |
| 143 | + } |
| 144 | + ], |
| 145 | + "@typescript-eslint/indent": "off", |
| 146 | + "@typescript-eslint/interface-name-prefix": "off", |
| 147 | + "@typescript-eslint/member-delimiter-style": [ |
| 148 | + "off", |
| 149 | + { |
| 150 | + "multiline": { |
| 151 | + "delimiter": "none", |
| 152 | + "requireLast": true |
| 153 | + }, |
| 154 | + "singleline": { |
| 155 | + "delimiter": "semi", |
| 156 | + "requireLast": false |
| 157 | + } |
| 158 | + } |
| 159 | + ], |
| 160 | + "@typescript-eslint/member-ordering": "off", |
| 161 | + "@typescript-eslint/no-empty-function": "error", |
| 162 | + "@typescript-eslint/no-namespace": "off", |
| 163 | + "@typescript-eslint/no-parameter-properties": "off", |
| 164 | + // eslint |
| 165 | + // eslint |
| 166 | + "brace-style": "off", |
| 167 | + "constructor-super": "error", |
| 168 | + "curly": ["error", "multi-line"], |
| 169 | + "dot-notation": "off", |
| 170 | + "eqeqeq": "error", |
| 171 | + "new-parens": "error", |
| 172 | + "no-caller": "error", |
| 173 | + "no-duplicate-case": "error", |
| 174 | + "no-duplicate-imports": "error", |
| 175 | + "no-empty": "error", |
| 176 | + "no-eval": "error", |
| 177 | + "no-extra-bind": "error", |
| 178 | + "no-fallthrough": "error", |
| 179 | + "no-new-func": "off", |
| 180 | + "no-new-wrappers": "error", |
| 181 | + "no-return-await": "error", |
| 182 | + "no-sparse-arrays": "error", |
| 183 | + "no-template-curly-in-string": "error", |
| 184 | + "no-throw-literal": "error", |
| 185 | + "no-trailing-spaces": "error", |
| 186 | + "no-undef-init": "error", |
| 187 | + "no-unsafe-finally": "error", |
| 188 | + "no-unused-labels": "error", |
| 189 | + "no-var": "error", |
| 190 | + "object-shorthand": "error", |
| 191 | + "prefer-const": "error", |
| 192 | + "prefer-object-spread": "error", |
| 193 | + "quote-props": "off", |
| 194 | + "space-in-parens": "error", |
| 195 | + "unicode-bom": ["error", "never"], |
| 196 | + "use-isnan": "error" |
26 | 197 | } |
27 | 198 | } |
0 commit comments