1 | const presentRulesOnly = require("./tools/presentRulesOnly");
|
2 |
|
3 | module.exports = {
|
4 | parser: "@typescript-eslint/parser",
|
5 | extends: ["plugin:import/typescript", "prettier"],
|
6 | plugins: ["@typescript-eslint"],
|
7 | parserOptions: {
|
8 | warnOnUnsupportedTypeScriptVersion: false,
|
9 | sourceType: "module",
|
10 | jsx: true,
|
11 | },
|
12 | settings: {
|
13 | "import/resolver": {
|
14 | typescript: {
|
15 | alwaysTryTypes: true,
|
16 | },
|
17 | },
|
18 | },
|
19 | rules: presentRulesOnly({
|
20 | "@typescript-eslint/adjacent-overload-signatures": "error",
|
21 | "@typescript-eslint/array-type": ["error", { default: "array" }],
|
22 | "@typescript-eslint/ban-ts-comment": "off",
|
23 | "@typescript-eslint/ban-tslint-comment": "error",
|
24 | "@typescript-eslint/ban-types": [
|
25 | "error",
|
26 | {
|
27 | types: {
|
28 | Array: false,
|
29 | Object: {
|
30 | message: "Use `object` instead",
|
31 | fixWith: "object",
|
32 | },
|
33 | object: "Use `{}` instead",
|
34 | String: {
|
35 | message: "Use `string` instead",
|
36 | fixWith: "string",
|
37 | },
|
38 | Number: {
|
39 | message: "Use `number` instead",
|
40 | fixWith: "number",
|
41 | },
|
42 | BigInt: {
|
43 | message: "Use `bigint` instead",
|
44 | fixWith: "bigint",
|
45 | },
|
46 | Boolean: {
|
47 | message: "Use `boolean` instead",
|
48 | fixWith: "boolean",
|
49 | },
|
50 | },
|
51 | },
|
52 | ],
|
53 | "brace-style": "off",
|
54 | "@typescript-eslint/brace-style": [
|
55 | "error",
|
56 | "1tbs",
|
57 | { allowSingleLine: true },
|
58 | ],
|
59 | "@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
60 | "comma-spacing": "off",
|
61 | "@typescript-eslint/comma-spacing": [
|
62 | "error",
|
63 | { before: false, after: true },
|
64 | ],
|
65 | "@typescript-eslint/consistent-type-assertions": "error",
|
66 | "@typescript-eslint/consistent-type-definitions": "off",
|
67 | "@typescript-eslint/default-param-last": "error",
|
68 | "@typescript-eslint/explicit-function-return-type": "off",
|
69 | "@typescript-eslint/explicit-member-accessibility": "off",
|
70 | "@typescript-eslint/explicit-module-boundary-types": "off",
|
71 | "@typescript-eslint/func-call-spacing": "off",
|
72 | "@typescript-eslint/indent": "off",
|
73 | "init-declarations": "off",
|
74 | "@typescript-eslint/init-declarations": ["error"],
|
75 | "keyword-spacing": "off",
|
76 | "@typescript-eslint/keyword-spacing": ["error"],
|
77 | "lines-between-class-members": "off",
|
78 | "@typescript-eslint/lines-between-class-members": [
|
79 | "error",
|
80 | "always",
|
81 | { exceptAfterSingleLine: true, exceptAfterOverload: true },
|
82 | ],
|
83 | "@typescript-eslint/member-delimiter-style": "off",
|
84 | "@typescript-eslint/member-ordering": "off",
|
85 | "@typescript-eslint/method-signature-style": "error",
|
86 | "@typescript-eslint/no-array-constructor": "error",
|
87 | "@typescript-eslint/no-confusing-non-null-assertion": "error",
|
88 | "no-dupe-class-members": "off",
|
89 | "@typescript-eslint/no-dupe-class-members": "error",
|
90 | "@typescript-eslint/no-dynamic-delete": "error",
|
91 | "no-empty-function": "off",
|
92 | "@typescript-eslint/no-empty-function": "off",
|
93 | "@typescript-eslint/no-empty-interface": "off",
|
94 | "@typescript-eslint/no-explicit-any": "off",
|
95 | "@typescript-eslint/no-extraneous-class": "error",
|
96 | "@typescript-eslint/no-extra-non-null-assertion": "error",
|
97 | "@typescript-eslint/no-extra-parens": "off",
|
98 | "no-extra-semi": "off",
|
99 | "@typescript-eslint/no-extra-semi": "error",
|
100 | "@typescript-eslint/no-inferrable-types": "error",
|
101 | "no-invalid-this": "off",
|
102 | "@typescript-eslint/no-invalid-this": "error",
|
103 | "@typescript-eslint/no-invalid-void-type": "error",
|
104 | "no-loss-of-precision": "error",
|
105 | "@typescript-eslint/no-loss-of-precision": "error",
|
106 | "@typescript-eslint/no-magic-numbers": "off",
|
107 | "@typescript-eslint/no-misused-new": "error",
|
108 | "@typescript-eslint/no-namespace": "error",
|
109 | "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
110 | "@typescript-eslint/no-non-null-assertion": "off",
|
111 | "@typescript-eslint/no-parameter-properties": "error",
|
112 | "@typescript-eslint/no-require-imports": "error",
|
113 | "@typescript-eslint/no-this-alias": "error",
|
114 | "@typescript-eslint/no-type-alias": "off",
|
115 | "no-unused-expressions": "off",
|
116 | "@typescript-eslint/no-unused-expressions": [
|
117 | "error",
|
118 | {
|
119 | allowShortCircuit: true,
|
120 | allowTernary: true,
|
121 | allowTaggedTemplates: true,
|
122 | },
|
123 | ],
|
124 | "no-unused-vars": "off",
|
125 | "@typescript-eslint/no-unused-vars": "off",
|
126 | "no-use-before-define": "off",
|
127 | "@typescript-eslint/no-use-before-define": "off",
|
128 | "no-useless-constructor": "off",
|
129 | "@typescript-eslint/no-useless-constructor": "error",
|
130 | "@typescript-eslint/no-var-requires": "error",
|
131 | "@typescript-eslint/prefer-as-const": "error",
|
132 | "@typescript-eslint/prefer-for-of": "error",
|
133 | "@typescript-eslint/prefer-function-type": "error",
|
134 | "@typescript-eslint/prefer-literal-enum-member": "error",
|
135 | "@typescript-eslint/prefer-namespace-keyword": "error",
|
136 | "@typescript-eslint/prefer-optional-chain": "error",
|
137 | "@typescript-eslint/prefer-ts-expect-error": "error",
|
138 | quotes: "off",
|
139 | "@typescript-eslint/quotes": "off",
|
140 | "@typescript-eslint/semi": "off",
|
141 | "@typescript-eslint/space-before-function-paren": "off",
|
142 | "@typescript-eslint/triple-slash-reference": [
|
143 | "error",
|
144 | { path: "never", types: "never", lib: "never" },
|
145 | ],
|
146 | "@typescript-eslint/typedef": "off",
|
147 | "@typescript-eslint/type-annotation-spacing": "off",
|
148 | "@typescript-eslint/unified-signatures": "off",
|
149 | "comma-dangle": "off",
|
150 | "@typescript-eslint/comma-dangle": "off",
|
151 | "@typescript-eslint/consistent-indexed-object-style": "error",
|
152 | "@typescript-eslint/consistent-type-imports": "error",
|
153 | "no-duplicate-imports": "off",
|
154 | "@typescript-eslint/no-duplicate-imports": "error",
|
155 | "@typescript-eslint/no-implicit-any-catch": [
|
156 | "error",
|
157 | {
|
158 | allowExplicitAny: true,
|
159 | },
|
160 | ],
|
161 | "@typescript-eslint/no-loop-func": "error",
|
162 | "@typescript-eslint/no-redeclare": "error",
|
163 | "@typescript-eslint/no-shadow": "off",
|
164 | "@typescript-eslint/no-unnecessary-type-constraint": "error",
|
165 | "@typescript-eslint/prefer-enum-initializers": "error",
|
166 | "@typescript-eslint/space-infix-ops": "error",
|
167 | "@typescript-eslint/object-curly-spacing": "off",
|
168 | "@typescript-eslint/sort-type-union-intersection-members": "off",
|
169 | "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
170 | "no-restricted-imports": "off",
|
171 | "@typescript-eslint/no-restricted-imports": "off",
|
172 | "padding-line-between-statements": "off",
|
173 | "@typescript-eslint/padding-line-between-statements": "off",
|
174 | "@typescript-eslint/consistent-generic-constructors": [
|
175 | "error",
|
176 | "constructor",
|
177 | ],
|
178 | "@typescript-eslint/no-duplicate-enum-values": "error",
|
179 | "@typescript-eslint/no-useless-empty-export": "error",
|
180 | "@typescript-eslint/parameter-properties": "off",
|
181 | "@typescript-eslint/space-before-blocks": "off",
|
182 | "@typescript-eslint/no-unsafe-declaration-merging": "error",
|
183 | "@typescript-eslint/sort-type-constituents": "off",
|
184 | "key-spacing": "off",
|
185 | "@typescript-eslint/key-spacing": "off",
|
186 | }),
|
187 | };
|