@egs33/eslint-config 2.2.1 → 3.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/es6.js ADDED
@@ -0,0 +1,192 @@
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
+ 'arrow-body-style': [
7
+ 'error', 'as-needed', {
8
+ requireReturnForObjectLiteral: false,
9
+ },
10
+ ],
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
+ '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
+ '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
+ 'no-confusing-arrow': [
34
+ 'error', {
35
+ allowParens: true,
36
+ },
37
+ ],
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
+ 'no-duplicate-imports': 'off',
50
+
51
+ // disallow symbol constructor
52
+ // https://eslint.org/docs/rules/no-new-symbol
53
+ 'no-new-symbol': 'error',
54
+
55
+ // Disallow specified names in exports
56
+ // https://eslint.org/docs/rules/no-restricted-exports
57
+ 'no-restricted-exports': [
58
+ 'error', {
59
+ restrictedNamedExports: [
60
+ 'default', // use `export default` to provide a default export
61
+ 'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
62
+ ],
63
+ },
64
+ ],
65
+
66
+ // disallow specific imports
67
+ // https://eslint.org/docs/rules/no-restricted-imports
68
+ 'no-restricted-imports': [
69
+ 'off', {
70
+ paths: [],
71
+ patterns: [],
72
+ },
73
+ ],
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
+ 'no-useless-computed-key': 'error',
82
+
83
+ // disallow unnecessary constructor
84
+ // https://eslint.org/docs/rules/no-useless-constructor
85
+ '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
+ 'no-useless-rename': [
90
+ 'error', {
91
+ ignoreDestructuring: false,
92
+ ignoreImport: false,
93
+ ignoreExport: false,
94
+ },
95
+ ],
96
+
97
+ // require let or const instead of var
98
+ 'no-var': 'error',
99
+
100
+ // require method and property shorthand syntax for object literals
101
+ // https://eslint.org/docs/rules/object-shorthand
102
+ 'object-shorthand': [
103
+ 'error', 'always', {
104
+ ignoreConstructors: false,
105
+ avoidQuotes: true,
106
+ },
107
+ ],
108
+
109
+ // suggest using arrow functions as callbacks
110
+ 'prefer-arrow-callback': [
111
+ 'error', {
112
+ allowNamedFunctions: false,
113
+ allowUnboundThis: true,
114
+ },
115
+ ],
116
+
117
+ // suggest using of const declaration for variables that are never modified after declared
118
+ 'prefer-const': [
119
+ 'error', {
120
+ destructuring: 'any',
121
+ ignoreReadBeforeAssign: true,
122
+ },
123
+ ],
124
+
125
+ // Prefer destructuring from arrays and objects
126
+ // https://eslint.org/docs/rules/prefer-destructuring
127
+ 'prefer-destructuring': [
128
+ 'error', {
129
+ VariableDeclarator: {
130
+ array: false,
131
+ object: true,
132
+ },
133
+ AssignmentExpression: {
134
+ array: true,
135
+ object: false,
136
+ },
137
+ }, {
138
+ enforceForRenamedProperties: false,
139
+ },
140
+ ],
141
+
142
+ // disallow parseInt() in favor of binary, octal, and hexadecimal literals
143
+ // https://eslint.org/docs/rules/prefer-numeric-literals
144
+ '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
+ 'prefer-rest-params': 'error',
153
+
154
+ // suggest using the spread syntax instead of .apply()
155
+ // https://eslint.org/docs/rules/prefer-spread
156
+ 'prefer-spread': 'error',
157
+
158
+ // suggest using template literals instead of string concatenation
159
+ // https://eslint.org/docs/rules/prefer-template
160
+ '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
+ '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
+ 'symbol-description': 'error',
184
+
185
+ // enforce usage of spacing in template strings
186
+ // https://eslint.org/docs/rules/template-curly-spacing
187
+ 'template-curly-spacing': 'error',
188
+
189
+ // enforce spacing around the * in yield* expressions
190
+ // https://eslint.org/docs/rules/yield-star-spacing
191
+ 'yield-star-spacing': ['error', 'after'],
192
+ };