-
Notifications
You must be signed in to change notification settings - Fork 37
/
.eslintrc.js
101 lines (97 loc) · 2.98 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"airbnb-base",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:eslint-comments/recommended",
"plugin:n/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier",
],
plugins: ["@typescript-eslint", "import", "simple-import-sort"],
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
ecmaVersion: 2020,
},
settings: {
"import/resolver": {
typescript: {},
},
"import/parsers": {
"@typescript-eslint/parser": [".ts"],
},
},
rules: {
complexity: ["error", 7],
"no-console": "off",
"no-else-return": "off",
"object-shorthand": "error",
"arrow-body-style": "off",
"no-restricted-syntax": "off",
"no-param-reassign": [
"error",
{
props: true,
ignorePropertyModificationsFor: ["draft", "state"],
},
],
"padding-line-between-statements": [
"error",
{
blankLine: "always",
prev: "*",
next: "return",
},
],
"no-return-await": "off",
"simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn",
"no-restricted-imports": ["error", { patterns: ["./", "../"] }],
"import/prefer-default-export": "off",
"import/extensions": ["error", "ignorePackages", { ts: "never" }],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/array-type": ["error", { default: "generic" }],
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-misused-promises": ["error", { checksVoidReturn: false }],
"eslint-comments/no-unused-disable": "error",
"n/no-unsupported-features/es-syntax": "off",
"n/no-missing-import": "off",
},
overrides: [
{
files: ["**/*.test.ts"],
extends: ["plugin:jest/recommended", "plugin:jest/style"],
plugins: ["jest"],
env: {
jest: true,
},
rules: {
"@typescript-eslint/no-empty-function": "off",
},
},
{
parserOptions: {
sourceType: "module",
project: "./tsconfig.webpack-jest.json",
},
files: ["./webpack.*.ts", "./jest.config.ts"],
rules: {
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
"no-restricted-imports": "off",
},
},
],
}