-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
48 lines (38 loc) · 1.34 KB
/
test.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
module.exports = {
env: {
mocha: true,
},
rules: {
// Allow test files to play more loosely with types.
"@typescript-eslint/explicit-function-return-type": "off",
// Allow non-null assertions in tests.
"@typescript-eslint/no-non-null-assertion": "off",
// Allow type aliases in tests.
"@typescript-eslint/no-type-alias": "off",
// Unit tests may need unbound method references for sinon.
"@typescript-eslint/unbound-method": "off",
// Test files may need to make stub classes, which don't need their own files.
"max-classes-per-file": "off",
// Allow test declarations to exceed max line length.
"max-len": ["error", {
code: 100,
ignorePattern: "^\\s*(?:x?it|specify|describe|context)(?:\\.skip)?\\(",
}],
// Prevent `only` from being left on a test or test group.
"no-restricted-properties": [
"error",
{object: "it", property: "only"},
{object: "specify", property: "only"},
{object: "describe", property: "only"},
{object: "context", property: "only"},
],
// Synchronous methods are okay for test runs.
"no-sync": "off",
// Unit tests may need to access 'private' members.
"no-underscore-dangle": "off",
// Needed for chai, which implements some assertions as getters.
"no-unused-expressions": 0,
// Non-arrow callbacks are recommended by mocha docs.
"prefer-arrow-callback": "off",
},
};