-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathes6.js
121 lines (91 loc) · 3.44 KB
/
es6.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* These rules relate to ES6, also known as ES2015
*/
module.exports = {
rules: {
// require braces in arrow function body
'arrow-body-style': ['error', 'as-needed', {
requireReturnForObjectLiteral: false,
}],
// require parens in arrow function arguments
'arrow-parens': ['error', 'as-needed'],
// require space before/after arrow function’s arrow
'arrow-spacing': 'error',
// verify calls of super() in constructors
'constructor-super': 'error',
// enforce spacing around the * in generator functions
'generator-star-spacing': ['error', { before: false, after: true }],
// disallow modifying variables of class declarations
'no-class-assign': 'error',
// disallow arrow functions where they could be confused with comparisons
'no-confusing-arrow': ['error', {
allowParens: true,
}],
// disallow modifying variables that are declared using const
'no-const-assign': 'error',
// disallow duplicate name in class members
'no-dupe-class-members': 'error',
// disallow duplicate imports
'no-duplicate-imports': 'error',
// disallow symbol constructor
'no-new-symbol': 'error',
// disallow specific imports
'no-restricted-imports': 'off',
// disallow use of this/super before calling super() in constructors.
'no-this-before-super': 'error',
// disallow unnecessary computed property keys on objects
'no-useless-computed-key': 'error',
// disallow unnecessary constructor
'no-useless-constructor': 'error',
// disallow renaming import, export, and destructured assignments to the same name
'no-useless-rename': ['error', {
ignoreDestructuring: false,
ignoreImport: false,
ignoreExport: false,
}],
// require let or const instead of var
'no-var': 'error',
// require object literal shorthand syntax
'object-shorthand': ['error', 'always', {
ignoreConstructors: false,
avoidQuotes: true,
}],
// suggest using arrow functions as callbacks
'prefer-arrow-callback': 'off',
// suggest using of const declaration for variables that are never modified after declared
'prefer-const': ['error', {
destructuring: 'any',
ignoreReadBeforeAssign: true,
}],
// prefer destructuring from arrays and objects
'prefer-destructuring': 'off',
// disallow parseInt() in favor of binary, octal, and hexadecimal literals
'prefer-numeric-literals': 'error',
// suggest using the rest parameters instead of arguments
'prefer-rest-params': 'error',
// suggest using the spread operator instead of .apply()
'prefer-spread': 'warn',
// suggest using template literals instead of string concatenation
'prefer-template': 'error',
// disallow generator functions that do not have yield
'require-yield': 'error',
// enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': ['error', 'never'],
// import sorting
'sort-imports': 'off',
// require symbol description
'symbol-description': 'error',
// enforce usage of spacing in template strings
'template-curly-spacing': 'error',
// enforce spacing around the * in yield* expressions
'yield-star-spacing': ['error', 'after']
},
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
// ecmaFeatures: {
// objectLiteralDuplicateProperties: false,
// generators: false
// }
}
}