-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.json
156 lines (156 loc) · 4.91 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["jest", "import", "unicorn", "@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": [
"plugin:@nx/typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error",
"no-restricted-syntax": [
"error",
"TSAsExpression[typeAnnotation.typeName.name!='const']"
],
"eqeqeq": "error",
"semi": "off",
"@typescript-eslint/member-delimiter-style": [
2,
{
"multiline": {
"delimiter": "none",
"requireLast": false
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/ban-ts-comment": 2,
"@typescript-eslint/ban-types": 2,
"@typescript-eslint/class-literal-property-style": 2,
"@typescript-eslint/naming-convention": 0,
"no-mixed-spaces-and-tabs": 0,
"@typescript-eslint/prefer-readonly": 2,
"@typescript-eslint/prefer-readonly-parameter-types": 0,
"@typescript-eslint/no-empty-function": [
2,
{ "allow": ["arrowFunctions"] }
],
"@typescript-eslint/no-empty-interface": 0,
"@typescript-eslint/no-non-null-assertion": 2,
"no-warning-comments": [2, { "terms": ["@todo"] }],
"jest/consistent-test-it": [2, { "fn": "it" }],
"jest/no-test-prefixes": 2,
"jest/require-top-level-describe": 2,
"jest/valid-title": [2, { "disallowedWords": ["should"] }],
"@typescript-eslint/strict-boolean-expressions": [2],
"import/no-default-export": 2,
"import/namespace": 0,
"import/no-unresolved": 0,
"unicorn/consistent-function-scoping": 0,
"unicorn/custom-error-definition": 2,
"unicorn/filename-case": [
2,
{
"case": "kebabCase"
}
],
"unicorn/no-abusive-eslint-disable": 2,
"unicorn/no-array-for-each": 2,
"unicorn/no-array-push-push": 2,
"unicorn/no-array-reduce": 2,
"unicorn/no-console-spaces": 0,
"unicorn/no-instanceof-array": 2,
"unicorn/no-lonely-if": 2,
"unicorn/no-nested-ternary": 2,
"unicorn/no-this-assignment": 2,
"unicorn/no-unsafe-regex": 2,
"unicorn/no-zero-fractions": 2,
"unicorn/prefer-add-event-listener": 2,
"unicorn/prefer-array-find": 2,
"unicorn/prefer-array-flat-map": 2,
"unicorn/prefer-array-index-of": 2,
"unicorn/prefer-array-some": 2,
"unicorn/prefer-date-now": 2,
"unicorn/prefer-dom-node-append": 2,
"unicorn/prefer-dom-node-dataset": 2,
"unicorn/prefer-dom-node-remove": 2,
"unicorn/prefer-dom-node-text-content": 2,
"unicorn/prefer-includes": 2,
"unicorn/prefer-keyboard-event-key": 2,
"unicorn/prefer-modern-dom-apis": 2,
"unicorn/prefer-reflect-apply": 2,
"unicorn/prefer-set-has": 2,
"unicorn/prefer-string-replace-all": 2,
"unicorn/prefer-string-slice": 2,
"unicorn/prefer-string-starts-ends-with": 2,
"unicorn/prefer-string-trim-start-end": 2,
"unicorn/prefer-ternary": 2,
"unicorn/prefer-type-error": 2,
"unicorn/throw-new-error": 2,
/**
* https://eslint.org/docs/rules/no-empty
*/
"no-empty": [
2,
{
// allows empty `catch` blocks
"allowEmptyCatch": true
}
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["jest.config.ts"],
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["*.spec.ts", "*.spec.tsx"],
"plugins": ["expect-type"],
"extends": ["plugin:eslint-plugin-expect-type/recommended"],
"rules": {
"expect-type/expect": [
"error",
{ "disableExpectTypeSnapshotFix": true }
]
}
}
]
}