-
Notifications
You must be signed in to change notification settings - Fork 83
/
.eslintrc.json
126 lines (126 loc) · 3.34 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
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
{
"env": {
"es6": true,
"browser": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2019
},
"plugins": [
"no-only-tests",
"simple-import-sort",
"es"
],
"extends": [
"vaadin/typescript",
"vaadin/testing",
"vaadin/prettier"
],
"rules": {
"@typescript-eslint/class-literal-property-style": "off",
"@typescript-eslint/class-methods-use-this": "off",
"@typescript-eslint/consistent-indexed-object-style": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/max-params": ["error", { "max": 5 }],
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-unused-expressions": "off",
"no-only-tests/no-only-tests": "error",
"simple-import-sort/imports": [
"error",
{
"groups": [
[
// Side-effects group
"^\\u0000",
// External group
"^",
// Vaadin group
"^@vaadin",
// Parent group
"^\\.\\.",
// Sibling group
"^\\."
]
]
}
],
"arrow-body-style": "off",
"func-names": "off",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-multi-assign": "off",
"no-param-reassign": "off",
"one-var": "off",
"prefer-destructuring": "off",
"prefer-object-has-own": "off",
"prefer-promise-reject-errors": "off",
"radix": "off"
},
"overrides": [
{
"files": ["packages/*/src/**/*.js"],
"rules": {
// Prevent using optional-chaining in source files, as it is not supported by Polymer analyzer
"es/no-optional-chaining": "error",
"no-restricted-syntax": [
"error",
{
"selector": "ForInStatement",
"message": "for..in loops are slower than Object.{keys,values,entries} and have their caveats."
},
{
"selector": "CallExpression[callee.property.name='validate']",
"message": "Don't call validate() directly - it bypasses manual validation mode. Use _requestValidation() instead"
}
]
}
},
{
"files": ["packages/*/src/**/*.d.ts"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^TItem" }]
}
},
{
"files": ["scripts/**/*.js", "*.js"],
"rules": {
"@typescript-eslint/no-require-imports": "off",
"no-console": "off"
}
},
{
"files": ["packages/**/test/**", "test/integration/**"],
"env": {
"mocha": true
},
"rules": {
"no-await-in-loop": "off",
"max-classes-per-file": "off",
"simple-import-sort/imports": [
"error",
{
"groups": [
[
// Testing tools group
"^(@web|@vaadin/chai-plugins|@vaadin/testing-helpers|sinon)",
// Side-effects group
"^\\u0000",
// External group
"^",
// Vaadin group
"^@vaadin",
// Parent group
"^\\.\\.",
// Sibling group
"^\\."
]
]
}
]
}
}
]
}