Skip to content

Commit e11c20b

Browse files
Replace jshint & jscs with eslint, and add new rules
1 parent af7cf2b commit e11c20b

9 files changed

+595
-321
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 8
9+
trim_trailing_whitespace = true

.eslintrc.json

+336
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"globals": {},
8+
"parser": "babel-eslint",
9+
"parserOptions": {
10+
"ecmaVersion": 7,
11+
"sourceType": "script"
12+
},
13+
"plugins": [
14+
"import"
15+
],
16+
"rules": {
17+
"array-bracket-spacing": [
18+
"error",
19+
"never"
20+
],
21+
"array-callback-return": "error",
22+
"arrow-parens": "off",
23+
"arrow-spacing": "error",
24+
"brace-style": [
25+
"error",
26+
"stroustrup",
27+
{
28+
"allowSingleLine": true
29+
}
30+
],
31+
"camelcase": [
32+
"error",
33+
{
34+
"properties": "always"
35+
}
36+
],
37+
"comma-dangle": [
38+
"error",
39+
"always-multiline"
40+
],
41+
"comma-spacing": [
42+
"error",
43+
{
44+
"after": true
45+
}
46+
],
47+
"comma-style": [
48+
"error",
49+
"last"
50+
],
51+
"complexity": "warn",
52+
"consistent-return": "error",
53+
"constructor-super": "error",
54+
"curly": "error",
55+
"dot-location": [
56+
"error",
57+
"property"
58+
],
59+
"dot-notation": [
60+
"error",
61+
{
62+
"allowPattern": "^[a-z]+(_[a-z]+)+$"
63+
}
64+
],
65+
"eol-last": "error",
66+
"eqeqeq": "error",
67+
"generator-star-spacing": [
68+
"error",
69+
{
70+
"after": true,
71+
"before": false
72+
}
73+
],
74+
"global-require": "error",
75+
"import/default": "error",
76+
"import/export": "error",
77+
"import/first": "error",
78+
"import/named": "error",
79+
"import/namespace": "error",
80+
"import/newline-after-import": "error",
81+
"import/no-absolute-path": "error",
82+
"import/no-extraneous-dependencies": [
83+
"error", {
84+
"devDependencies": [
85+
"test/**",
86+
"webpack.config.js"
87+
]
88+
}
89+
],
90+
"import/no-mutable-exports": "error",
91+
"import/no-named-default": "error",
92+
"import/no-unassigned-import": "error",
93+
"import/no-webpack-loader-syntax": "error",
94+
"import/order": [
95+
"error",
96+
{
97+
"groups": [
98+
["builtin", "external"],
99+
["index","sibling","parent","internal"]
100+
],
101+
"newlines-between": "always"
102+
}
103+
],
104+
"indent": [
105+
"error",
106+
8,
107+
{
108+
"SwitchCase": 1
109+
}
110+
],
111+
"key-spacing": [
112+
"error",
113+
{
114+
"afterColon": true,
115+
"beforeColon": false,
116+
"mode": "minimum"
117+
}
118+
],
119+
"keyword-spacing": "error",
120+
"linebreak-style": [
121+
"error",
122+
"unix"
123+
],
124+
"max-len": [
125+
"error",
126+
140
127+
],
128+
"max-nested-callbacks": [
129+
"error",
130+
4
131+
],
132+
"max-params": [
133+
"error",
134+
5
135+
],
136+
"new-cap": [
137+
"error",
138+
{
139+
"capIsNewExceptions": [
140+
"Array",
141+
"Boolean",
142+
"Error",
143+
"Number",
144+
"PageMod",
145+
"Object",
146+
"QueryInterface",
147+
"String",
148+
"Symbol"
149+
]
150+
}
151+
],
152+
"no-array-constructor": "error",
153+
"no-caller": "error",
154+
"no-case-declarations": "error",
155+
"no-catch-shadow": "error",
156+
"no-class-assign": "error",
157+
"no-cond-assign": [
158+
"error",
159+
"except-parens"
160+
],
161+
"no-confusing-arrow": [
162+
"error",
163+
{
164+
"allowParens": true
165+
}
166+
],
167+
"no-const-assign": "error",
168+
"no-div-regex": "error",
169+
"no-dupe-args": "error",
170+
"no-dupe-class-members": "error",
171+
"no-dupe-keys": "error",
172+
"no-duplicate-case": "error",
173+
"no-else-return": "error",
174+
"no-empty-character-class": "error",
175+
"no-empty-pattern": "error",
176+
"no-eval": "error",
177+
"no-ex-assign": "error",
178+
"no-fallthrough": "error",
179+
"no-floating-decimal": "error",
180+
"no-func-assign": "error",
181+
"no-implicit-coercion": [
182+
"error",
183+
{
184+
"boolean": true,
185+
"number": true,
186+
"string": true
187+
}
188+
],
189+
"no-implied-eval": "error",
190+
"no-inner-declarations": "error",
191+
"no-invalid-regexp": "error",
192+
"no-iterator": "error",
193+
"no-lonely-if": "error",
194+
"no-loop-func": "error",
195+
"no-multi-str": "error",
196+
"no-native-reassign": "error",
197+
"no-negated-in-lhs": "error",
198+
"no-new-func": "error",
199+
"no-new-object": "error",
200+
"no-new-symbol": "error",
201+
"no-new-wrappers": "error",
202+
"no-obj-calls": "error",
203+
"no-octal": "error",
204+
"no-octal-escape": "error",
205+
"no-param-reassign": "error",
206+
"no-proto": "error",
207+
"no-prototype-builtins": "error",
208+
"no-regex-spaces": "error",
209+
"no-return-assign": "error",
210+
"no-self-assign": "error",
211+
"no-self-compare": "error",
212+
"no-spaced-func": "error",
213+
"no-sparse-arrays": "error",
214+
"no-tabs": "error",
215+
"no-this-before-super": "error",
216+
"no-throw-literal": "error",
217+
"no-trailing-spaces": "error",
218+
"no-undef": "error",
219+
"no-unexpected-multiline": "error",
220+
"no-unmodified-loop-condition": "error",
221+
"no-unreachable": "error",
222+
"no-unsafe-finally": "error",
223+
"no-unsafe-negation": "error",
224+
"no-unused-vars": [
225+
"error",
226+
{
227+
"args": "none"
228+
}
229+
],
230+
"no-useless-call": "error",
231+
"no-useless-computed-key": "error",
232+
"no-var": "error",
233+
"no-void": "error",
234+
"no-with": "error",
235+
"object-curly-spacing": [
236+
"error",
237+
"never"
238+
],
239+
"one-var": [
240+
"error",
241+
"never"
242+
],
243+
"prefer-arrow-callback": "error",
244+
"prefer-const": "error",
245+
"prefer-rest-params": "error",
246+
"prefer-spread": "error",
247+
"quote-props": [
248+
"error",
249+
"as-needed"
250+
],
251+
"quotes": [
252+
"error",
253+
"single",
254+
{
255+
"allowTemplateLiterals": true
256+
}
257+
],
258+
"radix": "error",
259+
"rest-spread-spacing": "error",
260+
"semi": [
261+
"error",
262+
"always"
263+
],
264+
"semi-spacing": [
265+
"error",
266+
{
267+
"after": true,
268+
"before": false
269+
}
270+
],
271+
"sort-keys": [
272+
"error",
273+
"asc",
274+
{
275+
"caseSensitive": true,
276+
"natural": true
277+
}
278+
],
279+
"space-before-blocks": [
280+
"error",
281+
"always"
282+
],
283+
"space-before-function-paren": [
284+
"error",
285+
{
286+
"anonymous": "ignore",
287+
"named": "never"
288+
}
289+
],
290+
"space-in-parens": [
291+
"error",
292+
"never"
293+
],
294+
"space-infix-ops": "error",
295+
"space-unary-ops": [
296+
"error",
297+
{
298+
"nonwords": false,
299+
"words": false
300+
}
301+
],
302+
"spaced-comment": [
303+
"error",
304+
"always"
305+
],
306+
"strict": "error",
307+
"unicode-bom": "error",
308+
"use-isnan": "error",
309+
"valid-jsdoc": [
310+
"error",
311+
{
312+
"prefer": {
313+
"arg": "param",
314+
"argument": "param",
315+
"class": "constructor",
316+
"returns": "return",
317+
"virtual": "abstract"
318+
},
319+
"requireParamDescription": false,
320+
"requireReturn": false,
321+
"requireReturnDescription": false
322+
}
323+
],
324+
"valid-typeof": [
325+
"error",
326+
{
327+
"requireStringLiterals": true
328+
}
329+
],
330+
"wrap-iife": "error",
331+
"yoda": [
332+
"error",
333+
"never"
334+
]
335+
}
336+
}

0 commit comments

Comments
 (0)