1 | {
|
2 | "extends": "eslint:recommended",
|
3 | "parserOptions": {
|
4 | "ecmaVersion": 2017
|
5 | },
|
6 | "env": {
|
7 | "es6": true,
|
8 | "node": true,
|
9 | "browser": true
|
10 | },
|
11 | "overrides": [
|
12 | { "files": ["*.mjs"], "parserOptions": { "sourceType": "module" } },
|
13 | {
|
14 | "files": ["*.jsx"],
|
15 | "parserOptions": {
|
16 | "sourceType": "module",
|
17 | "ecmaFeatures": { "jsx": true }
|
18 | }
|
19 | }
|
20 | ],
|
21 | "rules": {
|
22 | "no-await-in-loop": "warn",
|
23 | "no-compare-neg-zero": "error",
|
24 | "no-extra-parens": ["warn", "all", {
|
25 | "nestedBinaryExpressions": false
|
26 | }],
|
27 | "no-template-curly-in-string": "error",
|
28 | "no-unsafe-negation": "error",
|
29 | "valid-jsdoc": ["error", {
|
30 | "requireReturn": false,
|
31 | "requireReturnDescription": false,
|
32 | "prefer": {
|
33 | "return": "returns",
|
34 | "arg": "param"
|
35 | },
|
36 | "preferType": {
|
37 | "String": "string",
|
38 | "Number": "number",
|
39 | "Boolean": "boolean",
|
40 | "Symbol": "symbol",
|
41 | "object": "Object",
|
42 | "function": "Function",
|
43 | "array": "Array",
|
44 | "date": "Date",
|
45 | "error": "Error",
|
46 | "null": "void"
|
47 | }
|
48 | }],
|
49 |
|
50 | "accessor-pairs": "warn",
|
51 | "array-callback-return": "error",
|
52 | "complexity": "warn",
|
53 | "consistent-return": "off",
|
54 | "curly": ["error", "multi-or-nest", "consistent"],
|
55 | "dot-location": ["error", "property"],
|
56 | "dot-notation": "error",
|
57 | "eqeqeq": "error",
|
58 | "no-empty-function": "error",
|
59 | "no-floating-decimal": "error",
|
60 | "no-implied-eval": "error",
|
61 | "no-invalid-this": "error",
|
62 | "no-lone-blocks": "error",
|
63 | "no-multi-spaces": "error",
|
64 | "no-new-func": "error",
|
65 | "no-new-wrappers": "error",
|
66 | "no-new": "error",
|
67 | "no-octal-escape": "error",
|
68 | "no-return-assign": "error",
|
69 | "no-return-await": "error",
|
70 | "no-self-compare": "error",
|
71 | "no-sequences": "error",
|
72 | "no-throw-literal": "error",
|
73 | "no-unmodified-loop-condition": "error",
|
74 | "no-unused-expressions": "error",
|
75 | "no-useless-call": "error",
|
76 | "no-useless-concat": "error",
|
77 | "no-useless-escape": "error",
|
78 | "no-useless-return": "error",
|
79 | "no-void": "error",
|
80 | "no-warning-comments": "warn",
|
81 | "prefer-promise-reject-errors": "error",
|
82 | "require-await": "warn",
|
83 | "wrap-iife": "error",
|
84 | "yoda": "error",
|
85 |
|
86 | "no-label-var": "error",
|
87 | "no-shadow": "error",
|
88 | "no-undef-init": "error",
|
89 |
|
90 | "callback-return": "error",
|
91 | "handle-callback-err": "error",
|
92 | "no-mixed-requires": "error",
|
93 | "no-new-require": "error",
|
94 | "no-path-concat": "error",
|
95 |
|
96 | "array-bracket-spacing": "error",
|
97 | "block-spacing": "error",
|
98 | "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
99 | "capitalized-comments": ["off", "always", { "ignoreConsecutiveComments": true }],
|
100 | "comma-dangle": ["error", "always-multiline"],
|
101 | "comma-spacing": "error",
|
102 | "comma-style": "error",
|
103 | "computed-property-spacing": "error",
|
104 | "consistent-this": ["error", "$this"],
|
105 | "eol-last": "error",
|
106 | "func-names": "error",
|
107 | "func-name-matching": "error",
|
108 | "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
109 | "indent": ["error", 2, { "SwitchCase": 1 }],
|
110 | "key-spacing": "error",
|
111 | "keyword-spacing": "error",
|
112 | "max-depth": "error",
|
113 | "max-len": ["error", 120, 2],
|
114 | "max-nested-callbacks": ["error", { "max": 4 }],
|
115 | "max-statements-per-line": ["error", { "max": 2 }],
|
116 | "new-cap": "off",
|
117 | "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
|
118 | "no-array-constructor": "error",
|
119 | "no-inline-comments": "off",
|
120 | "no-lonely-if": "error",
|
121 | "no-mixed-operators": "error",
|
122 | "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
|
123 | "no-new-object": "error",
|
124 | "no-spaced-func": "error",
|
125 | "no-trailing-spaces": "error",
|
126 | "no-unneeded-ternary": "error",
|
127 | "no-whitespace-before-property": "error",
|
128 | "nonblock-statement-body-position": ["error", "below"],
|
129 | "object-curly-spacing": ["error", "always"],
|
130 | "operator-assignment": "error",
|
131 | "operator-linebreak": ["error", "after"],
|
132 | "padded-blocks": ["error", "never"],
|
133 | "quote-props": ["error", "as-needed"],
|
134 | "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
|
135 | "semi-spacing": "error",
|
136 | "semi": "error",
|
137 | "space-before-blocks": "error",
|
138 | "space-before-function-paren": ["error", "never"],
|
139 | "space-in-parens": "error",
|
140 | "space-infix-ops": "error",
|
141 | "space-unary-ops": "error",
|
142 | "spaced-comment": "error",
|
143 | "template-tag-spacing": "error",
|
144 | "unicode-bom": "error",
|
145 |
|
146 | "arrow-body-style": "error",
|
147 | "arrow-parens": ["error", "always"],
|
148 | "arrow-spacing": "error",
|
149 | "no-duplicate-imports": "error",
|
150 | "no-useless-computed-key": "error",
|
151 | "no-useless-constructor": "error",
|
152 | "prefer-arrow-callback": "error",
|
153 | "prefer-numeric-literals": "error",
|
154 | "prefer-rest-params": "error",
|
155 | "prefer-spread": "error",
|
156 | "prefer-template": "error",
|
157 | "rest-spread-spacing": "error",
|
158 | "template-curly-spacing": "error",
|
159 | "yield-star-spacing": "error"
|
160 | }
|
161 | }
|