-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
98 lines (92 loc) · 2.96 KB
/
.eslintrc.json
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
{
"$schema": "https://json.schemastore.org/eslintrc",
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended",
// Disable conflicting rules with prettier
"prettier",
// Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
"plugin:prettier/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"arrow-parens": ["error", "as-needed"],
"camelcase": "error",
"comma-dangle": ["error", "never"],
"linebreak-style": ["error", "unix"],
"max-classes-per-file": ["error", 1],
"no-console": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
"no-duplicate-imports": "error",
"no-unused-expressions": "error",
"no-dupe-class-members": "off", // typescript signature overload
"no-undef": "off", // typescript already check this
"no-var": "error",
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"prefer-destructuring": [
"error",
{
"array": true,
"object": true
}
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"quote-props": ["error", "as-needed"],
// Import order plugin
"import/first": ["error"],
"import/newline-after-import": ["error"],
"import/no-extraneous-dependencies": ["error"],
"import/order": [
"error",
{
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"]
}
],
// typescript
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
"@typescript-eslint/consistent-type-exports": ["error", { "fixMixedExportsWithInlineTypeSpecifier": true }],
"@typescript-eslint/consistent-type-imports": ["error", { "prefer": "type-imports" }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }],
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-use-before-define": "off"
},
"overrides": [
{
"files": ["src/**/*.{test,spec}.ts"],
"rules": {
"no-unused-expressions": "off" // disabled for chai assertions
}
}
]
}