This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path.eslintrc
86 lines (83 loc) · 2.92 KB
/
.eslintrc
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
{
"root": true,
"extends": [
"airbnb-base",
"plugin:node/recommended-script"
],
"env": {
"es6": true,
"node": true,
"mocha": true,
"jest": true,
"protractor": true
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "script"
},
"plugins": [
"mocha-no-only"
],
"rules": {
"strict": ["error", "safe"],
"arrow-parens": ["error", "as-needed", {"requireForBlockBody": true}],
"max-classes-per-file": ["off"],
"prefer-object-spread": ["off"],
"prefer-const": ["error", {"destructuring": "all"}],
"one-var": ["error", {"initialized": "never"}],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "never",
"exports": "always-multiline",
"functions": "never"
}],
"no-unused-vars": ["warn", {"vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_"}],
"no-param-reassign": ["off"],
"no-underscore-dangle": ["off"],
"object-curly-newline": ["off"],
"class-methods-use-this": ["off"],
"operator-linebreak": ["off"],
"no-await-in-loop": ["off"],
"one-var-declaration-per-line": ["error", "initializations"],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/test/**/*.js", "**/*.spec.js", "**/example/*.js"]}],
// can be fixed later
"max-len": ["off", 120],
"no-use-before-define": ["error", { "functions": true, "classes": false, "variables": true }],
"no-shadow": ["error", {"builtinGlobals": false, "hoist": "functions", "allow": ["driver"]}],
"no-restricted-syntax": [
"error",
{
"selector": "ForInStatement",
"message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array."
},
{
"selector": "LabeledStatement",
"message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand."
},
{
"selector": "WithStatement",
"message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize."
}
],
// mocha-no-only
"mocha-no-only/mocha-no-only": "error",
// node
"node/exports-style": ["error", "exports"],
"node/prefer-global/buffer": ["error", "always"],
"node/prefer-global/console": ["error", "always"],
"node/prefer-global/process": ["error", "always"],
"node/prefer-global/text-decoder": ["error", "never"],
"node/prefer-global/text-encoder": ["error", "never"],
"node/prefer-global/url-search-params": ["error", "never"],
"node/prefer-global/url": ["error", "never"]
},
"overrides": [{
"files": ["**/example/**/*.js", "**/test/**/*.js", "**/*.spec.js"],
"rules": {
"prefer-arrow-callback": ["off"],
"func-names": ["off"],
"no-console": ["off"]
}
}]
}