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