UNPKG

3.14 kBJavaScriptView Raw
1module.exports = {
2 "root": true,
3
4 "env": {
5 "node": true,
6 "es6": true
7 },
8
9 "parserOptions": {
10 "ecmaVersion": 8
11 },
12
13 /**
14 * ESLint rules
15 *
16 * All available rules: http://eslint.org/docs/rules/
17 *
18 * Rules take the following form:
19 * "rule-name", [severity, { opts }]
20 * Severity: 2 == error, 1 == warning, 0 == off.
21 */
22 "rules": {
23 /**
24 * Enforced rules
25 */
26
27
28 // syntax preferences
29 "quotes": [2, "single", {
30 "avoidEscape": true,
31 "allowTemplateLiterals": true
32 }],
33 "semi": 2,
34 "no-extra-semi": 2,
35 "comma-style": [2, "last"],
36 "wrap-iife": [2, "inside"],
37 "spaced-comment": [2, "always", {
38 "markers": ["*"]
39 }],
40 "eqeqeq": [2],
41 "arrow-body-style": [2, "as-needed"],
42 "accessor-pairs": [2, {
43 "getWithoutSet": false,
44 "setWithoutGet": false
45 }],
46 "brace-style": [2, "1tbs", {"allowSingleLine": true}],
47 "curly": [2, "multi-or-nest", "consistent"],
48 "new-parens": 2,
49 "func-call-spacing": 2,
50 "arrow-parens": [2, "as-needed"],
51 "prefer-const": 2,
52 "quote-props": [2, "consistent"],
53
54 // anti-patterns
55 "no-var": 2,
56 "no-with": 2,
57 "no-multi-str": 2,
58 "no-caller": 2,
59 "no-implied-eval": 2,
60 "no-labels": 2,
61 "no-new-object": 2,
62 "no-octal-escape": 2,
63 "no-self-compare": 2,
64 "no-shadow-restricted-names": 2,
65 "no-cond-assign": 2,
66 "no-debugger": 2,
67 "no-dupe-keys": 2,
68 "no-duplicate-case": 2,
69 "no-empty-character-class": 2,
70 "no-unreachable": 2,
71 "no-unsafe-negation": 2,
72 "radix": 2,
73 "valid-typeof": 2,
74 "no-unused-vars": [2, { "args": "none", "vars": "local" }],
75 "no-implicit-globals": [2],
76
77 // es2015 features
78 "require-yield": 2,
79 "template-curly-spacing": [2, "never"],
80
81 // spacing details
82 "space-infix-ops": 2,
83 "space-in-parens": [2, "never"],
84 "space-before-function-paren": [2, "never"],
85 "no-whitespace-before-property": 2,
86 "keyword-spacing": [2, {
87 "overrides": {
88 "if": {"after": true},
89 "else": {"after": true},
90 "for": {"after": true},
91 "while": {"after": true},
92 "do": {"after": true},
93 "switch": {"after": true},
94 "return": {"after": true}
95 }
96 }],
97 "arrow-spacing": [2, {
98 "after": true,
99 "before": true
100 }],
101
102 // file whitespace
103 "no-multiple-empty-lines": [2, {"max": 2}],
104 "no-mixed-spaces-and-tabs": 2,
105 "no-trailing-spaces": 2,
106 "linebreak-style": [ process.platform === "win32" ? 0 : 2, "unix" ],
107 "indent": [2, 2, { "SwitchCase": 1, "CallExpression": {"arguments": 2}, "MemberExpression": 2 }],
108 "key-spacing": [2, {
109 "beforeColon": false
110 }]
111 }
112};