-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.json
79 lines (78 loc) · 2.63 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
{
"extends": [
"airbnb-base",
"plugin:mocha/recommended",
"prettier"
],
"plugins": [
"@typescript-eslint",
"chai-friendly",
"mocha",
"prettier"
],
"parser": "@typescript-eslint/parser",
"settings": {
// https://github.com/benmosher/eslint-plugin-import/issues/1615
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".json"]
}
}
},
"rules": {
// airbnb-base enables func-names, but conflicts with Mocha conventions
// https://mochajs.org/#arrow-functions
// https://github.com/airbnb/javascript/issues/433
"func-names": 0,
// airbnb-base enables no-unused-expressions, but conflicts with chai assertion expressions
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2,
"prettier/prettier": "error",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"import/prefer-default-export": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error", {
"argsIgnorePattern": "^_"
}
],
// https://github.com/benmosher/eslint-plugin-import/issues/1615
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"mjs": "never",
"ts": "never"
}
],
// no-use-before-define conflicts with clean code top-to-bottom rules
// https://github.com/eslint/eslint/issues/10589
// https://github.com/typescript-eslint/typescript-eslint/blob/v4.2.0/packages/eslint-plugin/docs/rules/no-use-before-define.md
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": [
"error", {
"functions": false,
"classes": false,
"variables": false,
"typedefs": false,
"enums": false
}
],
"mocha/no-setup-in-describe": "off",
// https://github.com/typescript-eslint/typescript-eslint/blob/v4.0.0/packages/eslint-plugin/docs/rules/no-shadow.md
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
// https://github.com/typescript-eslint/typescript-eslint/blob/v4.0.0/packages/eslint-plugin/docs/rules/no-redeclare.md
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": ["error"]
},
"env": {
"mocha": true
}
}