forked from bem/themekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
172 lines (166 loc) · 4.46 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"env": {
"browser": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
// see https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L122
"indent": [
2,
2,
{
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"FunctionDeclaration": {
"parameters": 1,
"body": 1
},
"FunctionExpression": {
"parameters": 1,
"body": 1
},
"CallExpression": {
"arguments": 1
},
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoreComments": false
}
],
"semi": [2, "never"],
"semi-spacing": [2, { "before": false, "after": true }],
"wrap-iife": [2, "inside"],
"no-use-before-define": [2, { "functions": true, "classes": true, "variables": true }],
"no-caller": 2,
"no-cond-assign": [2, "except-parens"],
"no-constant-condition": 2,
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty": [2, { "allowEmptyCatch": true }],
"no-extra-boolean-cast": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-new": 2,
"no-sparse-arrays": 2,
"no-undef": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"no-unused-vars": [
2,
{
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true,
"vars": "all",
"varsIgnorePattern": "^_"
}
],
"strict": 2,
"max-params": [2, 5],
"max-depth": [1, 4],
"no-eq-null": 0,
"no-unused-expressions": 0,
"dot-notation": 2,
"use-isnan": 2,
// Best practices
"block-scoped-var": 2,
"complexity": [0, 11],
"curly": [2, "multi-line"],
"eqeqeq": [2, "always", { "null": "ignore" }],
"no-else-return": 2,
"no-extra-bind": 2,
"no-implicit-coercion": 2,
"no-return-assign": 0,
"no-sequences": 2,
"yoda": 2,
// Variables
"no-var": 1,
// Codestyle
"arrow-parens": [2, "always"],
"array-bracket-spacing": [2, "never"],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"camelcase": [2, { "properties": "never" }],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": [2, { "before": false, "after": true }],
"eol-last": 2,
"func-call-spacing": [2, "never"],
"block-spacing": 2,
"keyword-spacing": [2, { "before": true, "after": true }],
"max-len": [
2,
{
"code": 100,
"ignoreUrls": true,
"ignoreComments": false,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignorePattern": "require"
}
],
"no-lonely-if": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multiple-empty-lines": [2, { "max": 1, "maxBOF": 0, "maxEOF": 0 }],
"no-trailing-spaces": 2,
"no-unneeded-ternary": 2,
"no-nested-ternary": 2,
"object-curly-spacing": [2, "always"],
"one-var-declaration-per-line": [2, "initializations"],
"one-var": [2, { "let": "never", "const": "never" }],
"padded-blocks": [2, "never"],
"quote-props": [2, "as-needed", { "numbers": true }],
"quotes": [2, "single", { "avoidEscape": true }],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [
2,
{
"asyncArrow": "always",
"anonymous": "never",
"named": "never"
}
],
"space-in-parens": 2,
"key-spacing": [2, { "beforeColon": false, "afterColon": true, "mode": "strict" }],
"space-infix-ops": 2,
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
"@typescript-eslint/consistent-type-assertions": 2,
"@typescript-eslint/no-empty-interface": 2,
"@typescript-eslint/no-unused-vars": [
2,
{
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true,
"vars": "all",
"varsIgnorePattern": "^_"
}
]
},
"overrides": [
{
"files": ["*.test.ts"],
"env": {
"jest": true
}
},
{
"files": ["*.js"],
"rules": {
"strict": 0
}
}
]
}