-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc
140 lines (139 loc) · 3.95 KB
/
.eslintrc
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
{
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "script"
},
"ignorePatterns": ["*.ts"],
"env": {
// "es2017": true,
"browser": true,
"greasemonkey": true,
"jquery": true
},
"extends": [
"plugin:unicorn/recommended",
"plugin:sonarjs/recommended",
"airbnb-base"
],
"plugins": [
"unicorn",
"sonarjs"
],
"rules": {
/* override default rule settings */
"array-bracket-newline": [
"error",
"consistent"
],
"array-element-newline": [
"error",
"consistent"
],
"arrow-parens": [
"error",
"always"
],
"curly": [
"error",
"multi-line",
"consistent"
],
"func-style": [
"error",
"declaration",
{ "allowArrowFunctions": true }
],
"indent": [
"error",
4,
{
"SwitchCase": 1,
"flatTernaryExpressions": true,
"ignoredNodes": ["TemplateLiteral *"] // no correct support in string templates
}
],
"id-blacklist": ["error", "e", "$e", "arguments"],
"key-spacing": [
"error",
{"mode": "minimum"} // to allow alignment
],
"max-len": [
"warn",
{
"code": 100,
"ignoreUrls": true
}
],
"max-statements-per-line": [
"error",
{ "max": 2 }
],
"multiline-ternary": [
"error",
"always-multiline"
],
"no-plusplus": [
"error",
{ "allowForLoopAfterthoughts": true }
],
// override airbnb's params
"no-restricted-syntax": [
"error",
{
"selector": "LabeledStatement",
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
}, {
"selector": "WithStatement",
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
}
],
"no-use-before-define": [
"error",
"nofunc" // funcs are hoisted
],
"no-unused-vars": [
"error",
{"args": "none"}
],
"quotes": [
"error",
"double",
{ "allowTemplateLiterals": true }
],
"one-var": [
"error",
{ "initialized": "never" }
],
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": "function", "next": "*" },
{ "blankLine": "always", "prev": "class", "next": "*" },
{ "blankLine": "always", "prev": "directive", "next": "*" }
],
"space-before-function-paren": [
"error",
"always"
],
"strict": [
"error",
"global"
],
"unicorn/no-unsafe-regex": "error",
"unicorn/template-indent": [ "error", { "indent": 4 } ],
/* disable */
"no-console": "off",
"no-mixed-operators": "off",
"no-multi-spaces": "off", // due allign
"no-nested-ternary": "off",
"no-new": "off", // due MutationSummary
"sonarjs/no-duplicate-string": "off",
"unicorn/catch-error-name": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/no-array-callback-reference": "off", // triggers on $.find()
"unicorn/no-null": "off", // too late, it should be done in 1995
"unicorn/prefer-module": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/switch-case-braces": ["error", "avoid"]
}
}