-
Notifications
You must be signed in to change notification settings - Fork 41
/
.eslintrc.extended.js
74 lines (74 loc) · 3.02 KB
/
.eslintrc.extended.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
module.exports = {
overrides: [
{
files: ['client/**/*.ts'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "BinaryExpression[operator='==='][right.type='Identifier'][right.name='undefined']",
message: 'Instead of using "=== undefined", please use the utils method isEmpty'
},
{
selector: "BinaryExpression[operator='!=='][right.type='Identifier'][right.name='undefined']",
message: 'Instead of using "!== undefined", please use the utils method !isEmpty'
},
{
selector: "BinaryExpression[operator='==='][right.type='Identifier'][right.name='null']",
message: 'Instead of using "=== null", please use the utils method isEmpty'
},
{
selector: "BinaryExpression[operator='!=='][right.type='Identifier'][right.name='null']",
message: 'Instead of using "!== null", please use the utils method !isEmpty'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='object']",
message: 'Instead of using "=== object", please use the utils method isObject'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='object']",
message: 'Instead of using "!== object", please use the utils method !isObject'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='string']",
message: 'Instead of using "=== string", please use the utils method isString'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='string']",
message: 'Instead of using "!== string", please use the utils method !isString'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='number']",
message: 'Instead of using "=== number", please use the utils method isNumber'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='number']",
message: 'Instead of using "!== number", please use the utils method !isNumber'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='boolean']",
message: 'Instead of using "=== boolean", please use the utils method isBoolean'
},
{
selector:
"BinaryExpression[operator='==='][left.type='UnaryExpression'][left.operator='typeof'][right.type='Literal'][right.value='boolean']",
message: 'Instead of using "!== boolean", please use the utils method !isBoolean'
}
]
}
},
{
files: ['test/**/*.ts'],
rules: {
'unicorn/no-useless-undefined': ['off']
}
}
]
};