-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
76 lines (75 loc) · 2.15 KB
/
.eslintrc.cjs
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
/** @type {import("@typescript-eslint/utils/dist/ts-eslint/Linter.d").Linter.Config} */
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
impliedStrict: true,
},
env: {
browser: true,
node: true,
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/naming-convention": [
"warn",
{
// Allow any format for quoted properties
selector: "property",
modifiers: ["requiresQuotes"],
format: null,
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
// Allow camelCase or upper_case for non-quoted properties
selector: "property",
leadingUnderscore: "allow",
trailingUnderscore: "allow",
format: ["camelCase", "UPPER_CASE"],
},
{
// Force PascalCase for types and typeLikes
selector: "typeLike",
format: ["PascalCase"],
},
{
// Allow leading Underscores for *unused* types and typeLikes
selector: "typeLike",
format: ["PascalCase"],
modifiers: ["unused"],
leadingUnderscore: "allow",
},
{
// Allow variables to be camelCase or CONSTANT and _underscores_
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
{
// Allow underscores on either side of camelCased defaults
selector: "default",
format: ["camelCase"],
leadingUnderscore: "allow",
trailingUnderscore: "allow",
},
],
// See documentation at https://typescript-eslint.io/rules/
"@typescript-eslint/semi": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/unified-signatures": "warn",
"no-throw-literal": "warn",
eqeqeq: "warn",
semi: "off",
},
ignorePatterns: ["out", "dist", "**/*.d.ts", "node_modules"],
};