-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
123 lines (119 loc) · 2.76 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true
},
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"prettier",
"jsdoc"
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
node: true,
spread: true
},
project: "./tsconfig.json"
},
rules: {
"@typescript-eslint/naming-convention": [
"error",
{
selector: "default",
format: ["camelCase"]
},
{
selector: ["class", "interface", "typeAlias", "enum", "typeParameter"],
format: ["PascalCase"]
},
{
selector: "enumMember",
format: ["UPPER_CASE"]
},
{
selector: "variable",
modifiers: ["const"],
format: ["UPPER_CASE", "camelCase"]
},
{
selector: ["classProperty", "classMethod"],
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require"
},
{
selector: ["variable", "parameter"],
modifiers: ["unused"],
format: null,
leadingUnderscore: "allow"
},
{
selector: "typeProperty",
format: ["camelCase"],
leadingUnderscore: "allowDouble"
}
],
"curly": "error",
"no-constant-condition": ["error", { checkLoops: false }],
"sort-imports": ["error", { ignoreDeclarationSort: true }],
"@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: true, ignoreProperties: true }],
"@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }],
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/strict-boolean-expressions": ["warn", { allowNullableBoolean: true }],
"jsdoc/no-types": "error",
"jsdoc/no-bad-blocks": "error",
"jsdoc/multiline-blocks": "error",
"jsdoc/empty-tags": "error",
"jsdoc/check-param-names": ["error", { enableFixer: true }],
"jsdoc/require-param": "error",
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
"no-empty-character-class": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/indent": "off",
},
settings: {
jsdoc: {
mode: "typescript"
}
},
overrides: [
{
files: ["scripts/**"],
env: {
browser: false,
node: true,
es6: true
},
parserOptions: {
project: "./scripts/tsconfig.json"
},
rules: {
"@typescript-eslint/no-var-requires": "off"
}
},
{
files: ["tests/**"],
parserOptions: {
project: "./tests/tsconfig.json"
}
}
],
ignorePatterns: [
"*.js",
"index.d.ts",
"src/js/unicode/**"
]
}