1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | module.exports = {
|
17 | "parser": "@typescript-eslint/parser",
|
18 | "plugins": [
|
19 | "@typescript-eslint",
|
20 | "promise",
|
21 | "import-helpers"
|
22 | ],
|
23 |
|
24 | "extends": [
|
25 | "plugin:import/typescript",
|
26 | "plugin:@typescript-eslint/eslint-recommended",
|
27 | "plugin:@typescript-eslint/recommended",
|
28 | "plugin:@typescript-eslint/recommended-requiring-type-checking",
|
29 | "airbnb-base"
|
30 | ],
|
31 |
|
32 | "settings": {
|
33 | "import/resolver": {
|
34 | "node": {
|
35 | "extensions": [
|
36 | ".ts",
|
37 | ".tsx",
|
38 | ".js",
|
39 | ".jsx"
|
40 | ]
|
41 | }
|
42 | }
|
43 | },
|
44 | "rules": {
|
45 |
|
46 | "brace-style": "off",
|
47 | "comma-dangle": "off",
|
48 | "comma-spacing": "off",
|
49 | "default-param-last": "off",
|
50 | "dot-notation": "off",
|
51 | "func-call-spacing": "off",
|
52 | "indent": "off",
|
53 | "init-declarations": "off",
|
54 | "keyword-spacing": "off",
|
55 | "lines-between-class-members": "off",
|
56 | "no-array-constructor": "off",
|
57 | "no-dupe-class-members": "off",
|
58 | "no-duplicate-imports": "off",
|
59 | "no-empty-function": "off",
|
60 | "no-extra-parens": "off",
|
61 | "no-extra-semi": "off",
|
62 | "no-invalid-this": "off",
|
63 | "no-loop-func": "off",
|
64 | "no-loss-of-precision": "off",
|
65 | "no-magic-numbers": "off",
|
66 | "no-redeclare": "off",
|
67 | "no-shadow": "off",
|
68 | "no-throw-literal": "off",
|
69 | "no-unused-expressions": "off",
|
70 | "no-unused-vars": "off",
|
71 | "no-use-before-define": "off",
|
72 | "no-useless-constructor": "off",
|
73 | "object-curly-spacing": "off",
|
74 | "quotes": "off",
|
75 | "require-await": "off",
|
76 | "no-return-await": "off",
|
77 | "semi": "off",
|
78 | "space-before-function-paren": "off",
|
79 | "space-infix-ops": "off",
|
80 |
|
81 |
|
82 | "spaced-comment": "warn",
|
83 | "linebreak-style": ["off", "unix"],
|
84 | "eol-last": ["error", "always"],
|
85 | "max-len": ["error", {
|
86 | "code": 225,
|
87 | "ignoreComments": false,
|
88 | "ignoreRegExpLiterals": true,
|
89 | "ignoreStrings": true,
|
90 | "ignoreTemplateLiterals": true,
|
91 | "ignoreUrls": true
|
92 | }],
|
93 | "no-case-declarations": "off",
|
94 | "no-console": "warn",
|
95 | "no-debugger": "warn",
|
96 | "no-multiple-empty-lines": ["warn", { "max": 1 }],
|
97 | "no-param-reassign": "error",
|
98 | "no-underscore-dangle": "error",
|
99 | "no-undefined": "warn",
|
100 | "multiline-ternary": ["error", "always-multiline"],
|
101 | "prefer-destructuring": "off",
|
102 | "object-shorthand": ["error", "consistent"],
|
103 | "object-property-newline": ["error", { "allowAllPropertiesOnSameLine": false }],
|
104 | "object-curly-newline": ["error", {
|
105 | "ObjectExpression": {
|
106 | "consistent": true,
|
107 | "multiline": true,
|
108 | "minProperties": 2
|
109 | },
|
110 | "ObjectPattern": {
|
111 | "consistent": true,
|
112 | "multiline": true
|
113 | },
|
114 | "ImportDeclaration": {
|
115 | "consistent": true,
|
116 | "multiline": true
|
117 | },
|
118 | "ExportDeclaration": {
|
119 | "consistent": true,
|
120 | "multiline": true
|
121 | }
|
122 | }],
|
123 | "function-paren-newline": ["error", "multiline"],
|
124 | "implicit-arrow-linebreak": ["error", "beside"],
|
125 | "jsx-quotes": ["error", "prefer-single"],
|
126 |
|
127 |
|
128 | "import/prefer-default-export": "off",
|
129 | "import/no-named-default": "off",
|
130 | "import/no-named-as-default": "off",
|
131 | "import/exports-last": "off",
|
132 | "import/group-exports": "off",
|
133 | "import/order": "off",
|
134 | "import/no-unused-modules": ["off", { "unusedExports": true }],
|
135 | "import/no-duplicates": "error",
|
136 | "import/newline-after-import": "error",
|
137 | "import/no-useless-path-segments": "error",
|
138 | "import/no-cycle": ["off", { "maxDepth": 2 }],
|
139 | "import/first": "error",
|
140 | "import/extensions": ["error", "ignorePackages", {
|
141 | "js": "never",
|
142 | "jsx": "never",
|
143 | "ts": "never",
|
144 | "tsx": "never"
|
145 | }],
|
146 | "import/no-extraneous-dependencies": ["error", { "devDependencies": ["**/*.test.*", "**/*.d.*", "**/setupTests.ts", "**/*.stories.*"] }],
|
147 |
|
148 |
|
149 | "import-helpers/order-imports": ["warn", {
|
150 | "newlinesBetween": "never",
|
151 | "groups": ["absolute", "module", "parent", "sibling", "index"],
|
152 | "alphabetize": { "order": "asc" }
|
153 | }],
|
154 |
|
155 |
|
156 | "promise/catch-or-return": "error",
|
157 | "promise/no-return-wrap": "error",
|
158 | "promise/param-names": "error",
|
159 | "promise/always-return": "error",
|
160 | "promise/no-native": "off",
|
161 | "promise/no-nesting": "error",
|
162 | "promise/no-promise-in-callback": "error",
|
163 | "promise/no-callback-in-promise": "error",
|
164 | "promise/avoid-new": "error",
|
165 | "promise/no-new-statics": "error",
|
166 | "promise/no-return-in-finally": "error",
|
167 | "promise/valid-params": "error",
|
168 | "promise/prefer-await-to-then": "error",
|
169 | "promise/prefer-await-to-callbacks": "off",
|
170 |
|
171 |
|
172 | "@typescript-eslint/brace-style": "error",
|
173 | "@typescript-eslint/comma-dangle": ["warn", {
|
174 | "arrays": "always-multiline",
|
175 | "objects": "always-multiline",
|
176 | "imports": "always-multiline",
|
177 | "exports": "always-multiline",
|
178 | "functions": "never",
|
179 | "enums": "always-multiline",
|
180 | "generics": "ignore",
|
181 | "tuples": "always-multiline"
|
182 | }],
|
183 | "@typescript-eslint/indent": ["error", 4, { "SwitchCase": 1 }],
|
184 | "@typescript-eslint/no-empty-function": "warn",
|
185 | "@typescript-eslint/no-extra-parens": ["warn", "all", {
|
186 | "nestedBinaryExpressions": false,
|
187 | "ignoreJSX": "all",
|
188 | "enforceForArrowConditionals": false,
|
189 | "enforceForNewInMemberExpressions": false
|
190 | }],
|
191 | "@typescript-eslint/no-unused-vars": "warn",
|
192 | "@typescript-eslint/lines-between-class-members": ["warn", "always"],
|
193 | "@typescript-eslint/quotes": ["error", "single", {
|
194 | "avoidEscape": false,
|
195 | "allowTemplateLiterals": false
|
196 | }],
|
197 | "@typescript-eslint/semi": ["warn", "never"],
|
198 | "@typescript-eslint/explicit-function-return-type": ["error", {
|
199 | "allowExpressions": true,
|
200 | "allowTypedFunctionExpressions": true,
|
201 | "allowHigherOrderFunctions": true
|
202 | }],
|
203 | "@typescript-eslint/naming-convention": ["error",
|
204 | {
|
205 | "selector": "interface",
|
206 | "format": ["PascalCase"],
|
207 | "custom": {
|
208 | "regex": "^I[A-Z]",
|
209 | "match": true
|
210 | }
|
211 | }
|
212 | ],
|
213 | "@typescript-eslint/interface-name-prefix": "off",
|
214 | "@typescript-eslint/promise-function-async": "error",
|
215 | "@typescript-eslint/type-annotation-spacing": "warn",
|
216 | "@typescript-eslint/object-curly-spacing": ["warn", "always"],
|
217 | "@typescript-eslint/no-implicit-any-catch": "warn",
|
218 | "@typescript-eslint/consistent-type-assertions": "warn",
|
219 | "@typescript-eslint/no-dynamic-delete": "error",
|
220 | "@typescript-eslint/prefer-ts-expect-error": "error",
|
221 | "@typescript-eslint/require-array-sort-compare": "error",
|
222 | "@typescript-eslint/default-param-last": "error"
|
223 | }
|
224 | }
|