-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.eslintrc.js
More file actions
106 lines (105 loc) · 3.84 KB
/
.eslintrc.js
File metadata and controls
106 lines (105 loc) · 3.84 KB
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
102
103
104
105
106
module.exports = {
ignorePatterns: [".yarn/", "**/.cache/", "**/dist/", "node_modules/"],
overrides: [
{
files: ["*.{ts,tsx,cts,js,jsx,cjs}"],
parserOptions: {
// Allows using modern syntax like `const` etc.
ecmaVersion: "latest",
},
rules: {
"no-var": "error",
},
},
{
files: ["*.{tsx,ts}"],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
ecmaFeatures: {
modules: true,
jsx: true,
},
project: true,
},
plugins: ["@typescript-eslint", "deprecation", "import", "jest"],
rules: {
curly: ["error", "all"],
eqeqeq: ["error", "smart"],
"import/no-extraneous-dependencies": "error",
"jest/no-focused-tests": "error",
"no-caller": "error",
"no-console": "error",
"no-debugger": "error",
"no-eval": "error",
"no-new-wrappers": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unsafe-finally": "error",
"no-var": "error",
"object-shorthand": ["error", "always"],
"prefer-const": "error",
radix: "error",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-wrapper-object-types": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
assertionStyle: "as",
objectLiteralTypeAssertions: "never",
},
],
"@typescript-eslint/consistent-type-imports": ["error"],
"@typescript-eslint/naming-convention": [
"error",
{ selector: "enumMember", format: ["PascalCase"] },
// Future rule:
// {
// selector: "variable",
// modifiers: ["const", "exported"],
// types: ["boolean", "array", "number", "string"],
// format: ["PascalCase"],
// },
],
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unnecessary-condition": [
"error",
{
allowConstantLoopConditions: true,
},
],
"@typescript-eslint/no-unnecessary-type-assertion": "error",
// Note: you must disable the base rule as it can report incorrect errors
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/return-await": ["error", "in-try-catch"],
"@typescript-eslint/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowAny: true, allowBoolean: true, allowNumber: true },
],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{ allowAny: true, allowNullableBoolean: true, allowNullableObject: true, allowNumber: false },
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"deprecation/deprecation": "error",
},
},
],
};