@egs33/eslint-config 3.0.2 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/airbnb/best-practices.js +7 -283
- package/airbnb/errors.js +4 -170
- package/airbnb/es6.js +0 -112
- package/airbnb/style.js +3 -521
- package/airbnb/variables.js +1 -32
- package/base.js +8 -6
- package/package.json +19 -19
- package/plugin-rules/imports.js +1 -9
- package/plugin-rules/stylistic.js +186 -0
- package/typescript-base.js +54 -8
- package/typescript-svelte.js +1 -2
package/airbnb/es6.js
CHANGED
|
@@ -1,59 +1,18 @@
|
|
|
1
1
|
export const es6 = {
|
|
2
|
-
|
|
3
|
-
// enforces no braces where they can be omitted
|
|
4
|
-
// https://eslint.org/docs/rules/arrow-body-style
|
|
5
|
-
// TODO: enable requireReturnForObjectLiteral?
|
|
6
2
|
'arrow-body-style': [
|
|
7
3
|
'error', 'as-needed', {
|
|
8
4
|
requireReturnForObjectLiteral: false,
|
|
9
5
|
},
|
|
10
6
|
],
|
|
11
|
-
|
|
12
|
-
// require parens in arrow function arguments
|
|
13
|
-
// https://eslint.org/docs/rules/arrow-parens
|
|
14
|
-
'arrow-parens': ['error', 'always'],
|
|
15
|
-
|
|
16
|
-
// require space before/after arrow function's arrow
|
|
17
|
-
// https://eslint.org/docs/rules/arrow-spacing
|
|
18
7
|
'arrow-spacing': ['error', { before: true, after: true }],
|
|
19
|
-
|
|
20
|
-
// verify super() callings in constructors
|
|
21
|
-
'constructor-super': 'error',
|
|
22
|
-
|
|
23
|
-
// enforce the spacing around the * in generator functions
|
|
24
|
-
// https://eslint.org/docs/rules/generator-star-spacing
|
|
25
8
|
'generator-star-spacing': ['error', { before: false, after: true }],
|
|
26
|
-
|
|
27
|
-
// disallow modifying variables of class declarations
|
|
28
|
-
// https://eslint.org/docs/rules/no-class-assign
|
|
29
|
-
'no-class-assign': 'error',
|
|
30
|
-
|
|
31
|
-
// disallow arrow functions where they could be confused with comparisons
|
|
32
|
-
// https://eslint.org/docs/rules/no-confusing-arrow
|
|
33
9
|
'no-confusing-arrow': [
|
|
34
10
|
'error', {
|
|
35
11
|
allowParens: true,
|
|
36
12
|
},
|
|
37
13
|
],
|
|
38
|
-
|
|
39
|
-
// disallow modifying variables that are declared using const
|
|
40
|
-
'no-const-assign': 'error',
|
|
41
|
-
|
|
42
|
-
// disallow duplicate class members
|
|
43
|
-
// https://eslint.org/docs/rules/no-dupe-class-members
|
|
44
|
-
'no-dupe-class-members': 'error',
|
|
45
|
-
|
|
46
|
-
// disallow importing from the same path more than once
|
|
47
|
-
// https://eslint.org/docs/rules/no-duplicate-imports
|
|
48
|
-
// replaced by https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
49
14
|
'no-duplicate-imports': 'off',
|
|
50
|
-
|
|
51
|
-
// disallow symbol constructor
|
|
52
|
-
// https://eslint.org/docs/rules/no-new-symbol
|
|
53
15
|
'no-new-symbol': 'error',
|
|
54
|
-
|
|
55
|
-
// Disallow specified names in exports
|
|
56
|
-
// https://eslint.org/docs/rules/no-restricted-exports
|
|
57
16
|
'no-restricted-exports': [
|
|
58
17
|
'error', {
|
|
59
18
|
restrictedNamedExports: [
|
|
@@ -62,30 +21,14 @@ export const es6 = {
|
|
|
62
21
|
],
|
|
63
22
|
},
|
|
64
23
|
],
|
|
65
|
-
|
|
66
|
-
// disallow specific imports
|
|
67
|
-
// https://eslint.org/docs/rules/no-restricted-imports
|
|
68
24
|
'no-restricted-imports': [
|
|
69
25
|
'off', {
|
|
70
26
|
paths: [],
|
|
71
27
|
patterns: [],
|
|
72
28
|
},
|
|
73
29
|
],
|
|
74
|
-
|
|
75
|
-
// disallow to use this/super before super() calling in constructors.
|
|
76
|
-
// https://eslint.org/docs/rules/no-this-before-super
|
|
77
|
-
'no-this-before-super': 'error',
|
|
78
|
-
|
|
79
|
-
// disallow useless computed property keys
|
|
80
|
-
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
81
30
|
'no-useless-computed-key': 'error',
|
|
82
|
-
|
|
83
|
-
// disallow unnecessary constructor
|
|
84
|
-
// https://eslint.org/docs/rules/no-useless-constructor
|
|
85
31
|
'no-useless-constructor': 'error',
|
|
86
|
-
|
|
87
|
-
// disallow renaming import, export, and destructured assignments to the same name
|
|
88
|
-
// https://eslint.org/docs/rules/no-useless-rename
|
|
89
32
|
'no-useless-rename': [
|
|
90
33
|
'error', {
|
|
91
34
|
ignoreDestructuring: false,
|
|
@@ -93,37 +36,25 @@ export const es6 = {
|
|
|
93
36
|
ignoreExport: false,
|
|
94
37
|
},
|
|
95
38
|
],
|
|
96
|
-
|
|
97
|
-
// require let or const instead of var
|
|
98
39
|
'no-var': 'error',
|
|
99
|
-
|
|
100
|
-
// require method and property shorthand syntax for object literals
|
|
101
|
-
// https://eslint.org/docs/rules/object-shorthand
|
|
102
40
|
'object-shorthand': [
|
|
103
41
|
'error', 'always', {
|
|
104
42
|
ignoreConstructors: false,
|
|
105
43
|
avoidQuotes: true,
|
|
106
44
|
},
|
|
107
45
|
],
|
|
108
|
-
|
|
109
|
-
// suggest using arrow functions as callbacks
|
|
110
46
|
'prefer-arrow-callback': [
|
|
111
47
|
'error', {
|
|
112
48
|
allowNamedFunctions: false,
|
|
113
49
|
allowUnboundThis: true,
|
|
114
50
|
},
|
|
115
51
|
],
|
|
116
|
-
|
|
117
|
-
// suggest using of const declaration for variables that are never modified after declared
|
|
118
52
|
'prefer-const': [
|
|
119
53
|
'error', {
|
|
120
54
|
destructuring: 'any',
|
|
121
55
|
ignoreReadBeforeAssign: true,
|
|
122
56
|
},
|
|
123
57
|
],
|
|
124
|
-
|
|
125
|
-
// Prefer destructuring from arrays and objects
|
|
126
|
-
// https://eslint.org/docs/rules/prefer-destructuring
|
|
127
58
|
'prefer-destructuring': [
|
|
128
59
|
'error', {
|
|
129
60
|
VariableDeclarator: {
|
|
@@ -138,55 +69,12 @@ export const es6 = {
|
|
|
138
69
|
enforceForRenamedProperties: false,
|
|
139
70
|
},
|
|
140
71
|
],
|
|
141
|
-
|
|
142
|
-
// disallow parseInt() in favor of binary, octal, and hexadecimal literals
|
|
143
|
-
// https://eslint.org/docs/rules/prefer-numeric-literals
|
|
144
72
|
'prefer-numeric-literals': 'error',
|
|
145
|
-
|
|
146
|
-
// suggest using Reflect methods where applicable
|
|
147
|
-
// https://eslint.org/docs/rules/prefer-reflect
|
|
148
|
-
'prefer-reflect': 'off',
|
|
149
|
-
|
|
150
|
-
// use rest parameters instead of arguments
|
|
151
|
-
// https://eslint.org/docs/rules/prefer-rest-params
|
|
152
73
|
'prefer-rest-params': 'error',
|
|
153
|
-
|
|
154
|
-
// suggest using the spread syntax instead of .apply()
|
|
155
|
-
// https://eslint.org/docs/rules/prefer-spread
|
|
156
74
|
'prefer-spread': 'error',
|
|
157
|
-
|
|
158
|
-
// suggest using template literals instead of string concatenation
|
|
159
|
-
// https://eslint.org/docs/rules/prefer-template
|
|
160
75
|
'prefer-template': 'error',
|
|
161
|
-
|
|
162
|
-
// disallow generator functions that do not have yield
|
|
163
|
-
// https://eslint.org/docs/rules/require-yield
|
|
164
|
-
'require-yield': 'error',
|
|
165
|
-
|
|
166
|
-
// enforce spacing between object rest-spread
|
|
167
|
-
// https://eslint.org/docs/rules/rest-spread-spacing
|
|
168
76
|
'rest-spread-spacing': ['error', 'never'],
|
|
169
|
-
|
|
170
|
-
// import sorting
|
|
171
|
-
// https://eslint.org/docs/rules/sort-imports
|
|
172
|
-
'sort-imports': [
|
|
173
|
-
'off', {
|
|
174
|
-
ignoreCase: false,
|
|
175
|
-
ignoreDeclarationSort: false,
|
|
176
|
-
ignoreMemberSort: false,
|
|
177
|
-
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
|
|
181
|
-
// require a Symbol description
|
|
182
|
-
// https://eslint.org/docs/rules/symbol-description
|
|
183
77
|
'symbol-description': 'error',
|
|
184
|
-
|
|
185
|
-
// enforce usage of spacing in template strings
|
|
186
|
-
// https://eslint.org/docs/rules/template-curly-spacing
|
|
187
78
|
'template-curly-spacing': 'error',
|
|
188
|
-
|
|
189
|
-
// enforce spacing around the * in yield* expressions
|
|
190
|
-
// https://eslint.org/docs/rules/yield-star-spacing
|
|
191
79
|
'yield-star-spacing': ['error', 'after'],
|
|
192
80
|
};
|