Skip to content

Commit 3c1afee

Browse files
committedJan 6, 2021
add eslintrc file
1 parent 460735f commit 3c1afee

File tree

2 files changed

+208
-0
lines changed

2 files changed

+208
-0
lines changed
 

‎.eslintrc.json

+207
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 2018,
4+
"ecmaFeatures": {},
5+
"sourceType": "script"
6+
},
7+
8+
"env": {
9+
"es6": true,
10+
"node": true
11+
},
12+
13+
"plugins": [
14+
"import",
15+
"node",
16+
"promise",
17+
"standard"
18+
],
19+
20+
"globals": {
21+
"document": "readonly",
22+
"navigator": "readonly",
23+
"window": "readonly"
24+
},
25+
26+
"rules": {
27+
"accessor-pairs": "error",
28+
"array-bracket-spacing": ["error", "never"],
29+
"arrow-spacing": ["error", { "before": true, "after": true }],
30+
"block-spacing": ["error", "always"],
31+
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
32+
"camelcase": ["error", { "properties": "never" }],
33+
"comma-dangle": ["error", {
34+
"arrays": "always-multiline",
35+
"objects": "always-multiline",
36+
"imports": "always-multiline",
37+
"exports": "always-multiline",
38+
"functions": "never"
39+
}],
40+
"comma-spacing": ["error", { "before": false, "after": true }],
41+
"comma-style": ["error", "last"],
42+
"computed-property-spacing": ["error", "never"],
43+
"constructor-super": "error",
44+
"curly": ["error", "multi-or-nest"],
45+
"dot-location": ["error", "property"],
46+
"dot-notation": ["error", { "allowKeywords": true }],
47+
"eol-last": "error",
48+
"eqeqeq": ["error", "always", { "null": "ignore" }],
49+
"func-call-spacing": ["error", "never"],
50+
"generator-star-spacing": ["error", { "before": true, "after": true }],
51+
"handle-callback-err": ["error", "^(err|error)$" ],
52+
"indent": ["error", 2, {
53+
"SwitchCase": 1,
54+
"VariableDeclarator": 1,
55+
"outerIIFEBody": 1,
56+
"MemberExpression": 1,
57+
"FunctionDeclaration": { "parameters": 1, "body": 1 },
58+
"FunctionExpression": { "parameters": 1, "body": 1 },
59+
"CallExpression": { "arguments": 1 },
60+
"ArrayExpression": 1,
61+
"ObjectExpression": 1,
62+
"ImportDeclaration": 1,
63+
"flatTernaryExpressions": true,
64+
"ignoreComments": false,
65+
"ignoredNodes": ["TemplateLiteral *"]
66+
}],
67+
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
68+
"keyword-spacing": ["error", { "before": true, "after": true }],
69+
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
70+
"new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }],
71+
"new-parens": "error",
72+
"no-array-constructor": "error",
73+
"no-async-promise-executor": "error",
74+
"no-caller": "error",
75+
"no-case-declarations": "error",
76+
"no-class-assign": "error",
77+
"no-compare-neg-zero": "error",
78+
"no-cond-assign": "off",
79+
"no-const-assign": "error",
80+
"no-constant-condition": ["error", { "checkLoops": false }],
81+
"no-control-regex": "error",
82+
"no-debugger": "error",
83+
"no-delete-var": "error",
84+
"no-dupe-args": "error",
85+
"no-dupe-class-members": "error",
86+
"no-dupe-keys": "error",
87+
"no-duplicate-case": "error",
88+
"no-empty-character-class": "error",
89+
"no-empty-pattern": "error",
90+
"no-eval": "error",
91+
"no-ex-assign": "error",
92+
"no-extend-native": "error",
93+
"no-extra-bind": "error",
94+
"no-extra-boolean-cast": "error",
95+
"no-extra-parens": ["error", "functions"],
96+
"no-fallthrough": "off",
97+
"no-floating-decimal": "error",
98+
"no-func-assign": "error",
99+
"no-global-assign": "error",
100+
"no-implied-eval": "error",
101+
"no-inner-declarations": ["error", "functions"],
102+
"no-invalid-regexp": "error",
103+
"no-irregular-whitespace": "error",
104+
"no-iterator": "error",
105+
"no-labels": ["error", { "allowLoop": true, "allowSwitch": false }],
106+
"no-lone-blocks": "error",
107+
"no-misleading-character-class": "error",
108+
"no-prototype-builtins": "error",
109+
"no-useless-catch": "error",
110+
"no-mixed-operators": "off",
111+
"no-mixed-spaces-and-tabs": "error",
112+
"no-multi-spaces": "error",
113+
"no-multi-str": "error",
114+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
115+
"no-negated-in-lhs": "error",
116+
"no-new": "off",
117+
"no-new-func": "error",
118+
"no-new-object": "error",
119+
"no-new-require": "error",
120+
"no-new-symbol": "error",
121+
"no-new-wrappers": "error",
122+
"no-obj-calls": "error",
123+
"no-octal": "error",
124+
"no-octal-escape": "error",
125+
"no-path-concat": "error",
126+
"no-proto": "error",
127+
"no-redeclare": ["error", { "builtinGlobals": false }],
128+
"no-regex-spaces": "error",
129+
"no-return-assign": "off",
130+
"no-self-assign": "off",
131+
"no-self-compare": "error",
132+
"no-sequences": "off",
133+
"no-shadow-restricted-names": "error",
134+
"no-sparse-arrays": "error",
135+
"no-tabs": "error",
136+
"no-template-curly-in-string": "error",
137+
"no-this-before-super": "error",
138+
"no-throw-literal": "off",
139+
"no-trailing-spaces": "error",
140+
"no-undef": "error",
141+
"no-undef-init": "error",
142+
"no-unexpected-multiline": "error",
143+
"no-unmodified-loop-condition": "error",
144+
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
145+
"no-unreachable": "error",
146+
"no-unsafe-finally": 0,
147+
"no-unsafe-negation": "error",
148+
"no-unused-expressions": ["off"],
149+
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
150+
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
151+
"no-useless-call": "error",
152+
"no-useless-computed-key": "error",
153+
"no-useless-constructor": "error",
154+
"no-useless-escape": "error",
155+
"no-useless-rename": "error",
156+
"no-useless-return": "error",
157+
"no-void": "error",
158+
"no-whitespace-before-property": "error",
159+
"no-with": "error",
160+
"nonblock-statement-body-position": [2, "below"],
161+
"object-curly-newline": "off",
162+
"object-curly-spacing": "off",
163+
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
164+
"one-var": ["error", { "initialized": "never" }],
165+
"operator-linebreak": "off",
166+
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
167+
"prefer-const": ["error", {"destructuring": "all"}],
168+
"prefer-promise-reject-errors": "error",
169+
"quote-props": ["error", "as-needed"],
170+
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
171+
"rest-spread-spacing": ["error", "never"],
172+
"semi": ["error", "never"],
173+
"semi-spacing": ["error", { "before": false, "after": true }],
174+
"space-before-blocks": ["error", "always"],
175+
"space-before-function-paren": ["error", "always"],
176+
"space-in-parens": ["error", "never"],
177+
"space-infix-ops": "error",
178+
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
179+
"spaced-comment": ["error", "always", {
180+
"line": { "markers": ["*package", "!", "/", ",", "="] },
181+
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
182+
}],
183+
"symbol-description": "error",
184+
"template-curly-spacing": ["error", "never"],
185+
"template-tag-spacing": ["error", "never"],
186+
"unicode-bom": ["error", "never"],
187+
"use-isnan": "error",
188+
"valid-typeof": ["error", { "requireStringLiterals": true }],
189+
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
190+
"yield-star-spacing": ["error", "both"],
191+
"yoda": ["error", "never"],
192+
193+
"import/export": "error",
194+
"import/first": "error",
195+
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
196+
"import/no-duplicates": "error",
197+
"import/no-named-default": "error",
198+
"import/no-webpack-loader-syntax": "error",
199+
200+
"node/no-deprecated-api": "error",
201+
"node/process-exit-as-throw": "error",
202+
203+
"promise/param-names": "off",
204+
205+
"standard/no-callback-literal": "error"
206+
}
207+
}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
!map.js
2222
!index.js
2323
!.github
24+
!.eslintrc.json
2425

2526
.*.swp
2627
node_modules/

0 commit comments

Comments
 (0)
Please sign in to comment.