-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.json
52 lines (52 loc) · 1.84 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
{
"parserOptions": {
"sourceType": "script"
},
"env": {
"browser": true,
"node": true
},
"extends": [
"eslint:recommended",
"standard",
"prettier"
],
"rules": {
"no-restricted-syntax": [
2,
{
"selector": "CallExpression[callee.property.name='toString']:not(:matches([arguments.0]))",
"message": "Use template literals instead of .toString()"
},
{
"selector": "CallExpression:matches([callee.name='format'], [callee.property.name='write']):not(:matches([arguments.0.type='Literal'], [arguments.0.type='Identifier']:matches([arguments.0.name='fmt'], [arguments.0.name='close'])))",
"message": "Only literals or 'fmt' / 'close' identifiers are allowed as first format() and .write() argument (fmt)"
},
{
"selector": ":not(:matches([id.name='format'], [key.name='write'])) > [params] > Identifier:matches([name='fmt'], [name='close'])",
"message": "Identifiers 'fmt' / 'close' can be only defined as format() and .write() arguments"
},
{
"selector": "VariableDeclarator > .id:matches([name='fmt'], [name='close'])",
"message": "Identifiers 'fmt' / 'close' can be only defined as function arguments"
},
{
"selector": "VariableDeclarator > .id :matches([name='fmt'], [name='close'])",
"message": "Identifiers 'fmt' / 'close' can be only defined as function arguments"
}
],
"strict": 2,
"no-else-return": 2,
"no-fallthrough": 2,
"no-param-reassign": 2,
"no-proto": 2,
"no-prototype-builtins": 2,
"no-shadow": 2,
"no-unused-vars": [2, { "vars": "all", "args": "after-used", "ignoreRestSiblings": true }],
"prefer-const": 2,
"prefer-object-spread": 2,
"prefer-template": 2,
"valid-typeof": [2, { "requireStringLiterals": true }],
"no-var": 2
}
}