1 | ;
|
2 |
|
3 | module.exports = {
|
4 | env: {
|
5 | es6: true,
|
6 | },
|
7 | parserOptions: {
|
8 | ecmaVersion: 6,
|
9 | },
|
10 | rules: {
|
11 | // enforces no braces where they can be omitted
|
12 | "arrow-body-style": [2, "as-needed"],
|
13 |
|
14 | // always require parentheses in arrow functions
|
15 | "arrow-parens": 2,
|
16 |
|
17 | // require spaces before and after arrow functions
|
18 | "arrow-spacing": 2,
|
19 |
|
20 | // verify super() calls in constructors
|
21 | "constructor-super": 2,
|
22 |
|
23 | // warn against modifying class variables
|
24 | "no-class-assign": 1,
|
25 |
|
26 | // disallow confusing arrow functions
|
27 | "no-confusing-arrow": [2, { allowParens: true }],
|
28 |
|
29 | // disallow modifying const variable references
|
30 | "no-const-assign": 2,
|
31 |
|
32 | // disallow duplicate class members
|
33 | "no-dupe-class-members": 2,
|
34 |
|
35 | // disallow importing from the same path more than once
|
36 | // NOTE: replaced with eslint-plugin-imports/no-duplicates
|
37 | "no-duplicate-imports": 0,
|
38 |
|
39 | // disallow the symbol constructor
|
40 | "no-new-symbol": 2,
|
41 |
|
42 | // disallow the use of `this` before calling `super()` in constructors
|
43 | "no-this-before-super": 2,
|
44 |
|
45 | // disallow useless computed property keys
|
46 | "no-useless-computed-key": 2,
|
47 |
|
48 | // disallow empty constructors
|
49 | "no-useless-constructor": 2,
|
50 |
|
51 | // disallow renamin gimport, export, and destructured assignments to the same name
|
52 | "no-useless-rename": 2,
|
53 |
|
54 | // disallow the use of var
|
55 | "no-var": 2,
|
56 |
|
57 | // always require object shorthand when possible
|
58 | "object-shorthand": [2, "always"],
|
59 |
|
60 | // require using arrow functions as callbacks
|
61 | "prefer-arrow-callback": [2, { allowNamedFunctions: true }],
|
62 |
|
63 | // require constant use when variable isn't reassigned
|
64 | "prefer-const": [2, { destructuring: "all" }],
|
65 |
|
66 | // disallow parseInt(string, radix) in favor of binary, octal, and hexadecimal literals
|
67 | "prefer-numeric-literals": 2,
|
68 |
|
69 | // require using rest params over arguments
|
70 | "prefer-rest-params": 2,
|
71 |
|
72 | // require using template strings over concatenation
|
73 | "prefer-template": 2,
|
74 |
|
75 | // prefer using spread over .apply()
|
76 | "prefer-spread": 1,
|
77 |
|
78 | // disallow generator functions that do not have yield
|
79 | "require-yield": 2,
|
80 |
|
81 | // disallow spaces between rest operator and expression
|
82 | "rest-spread-spacing": 2,
|
83 |
|
84 | // disallow spacing in curly braces of template strings
|
85 | "template-curly-spacing": 2,
|
86 |
|
87 | // enforce spacing around the * in yield* expressions
|
88 | "yield-star-spacing": [2, "after"],
|
89 | },
|
90 | };
|