@jeroenpol/eslint-config 1.0.5 → 1.0.6

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/rules/es6.js DELETED
@@ -1,185 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es6: true
4
- },
5
- parserOptions: {
6
- ecmaVersion: 6,
7
- sourceType: 'module',
8
- ecmaFeatures: {
9
- generators: false,
10
- objectLiteralDuplicateProperties: false
11
- }
12
- },
13
-
14
- rules: {
15
- // enforces no braces where they can be omitted
16
- // https://eslint.org/docs/rules/arrow-body-style
17
- // TODO: enable requireReturnForObjectLiteral?
18
- 'arrow-body-style': ['error', 'as-needed', {
19
- requireReturnForObjectLiteral: false,
20
- }],
21
-
22
- // require parens in arrow function arguments
23
- // https://eslint.org/docs/rules/arrow-parens
24
- 'arrow-parens': ['error', 'always'],
25
-
26
- // require space before/after arrow function's arrow
27
- // https://eslint.org/docs/rules/arrow-spacing
28
- 'arrow-spacing': ['error', { before: true, after: true }],
29
-
30
- // verify super() callings in constructors
31
- 'constructor-super': 'error',
32
-
33
- // enforce the spacing around the * in generator functions
34
- // https://eslint.org/docs/rules/generator-star-spacing
35
- 'generator-star-spacing': ['error', { before: false, after: true }],
36
-
37
- // disallow modifying variables of class declarations
38
- // https://eslint.org/docs/rules/no-class-assign
39
- 'no-class-assign': 'error',
40
-
41
- // disallow arrow functions where they could be confused with comparisons
42
- // https://eslint.org/docs/rules/no-confusing-arrow
43
- 'no-confusing-arrow': ['error', {
44
- allowParens: true,
45
- }],
46
-
47
- // disallow modifying variables that are declared using const
48
- 'no-const-assign': 'error',
49
-
50
- // disallow duplicate class members
51
- // https://eslint.org/docs/rules/no-dupe-class-members
52
- 'no-dupe-class-members': 'error',
53
-
54
- // disallow importing from the same path more than once
55
- // https://eslint.org/docs/rules/no-duplicate-imports
56
- // replaced by https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
57
- 'no-duplicate-imports': 'off',
58
-
59
- // disallow symbol constructor
60
- // https://eslint.org/docs/rules/no-new-symbol
61
- 'no-new-symbol': 'error',
62
-
63
- // Disallow specified names in exports
64
- // https://eslint.org/docs/rules/no-restricted-exports
65
- 'no-restricted-exports': ['error', {
66
- restrictedNamedExports: [
67
- 'default', // use `export default` to provide a default export
68
- 'then', // this will cause tons of confusion when your module is dynamically `import()`ed, and will break in most node ESM versions
69
- ],
70
- }],
71
-
72
- // disallow specific imports
73
- // https://eslint.org/docs/rules/no-restricted-imports
74
- 'no-restricted-imports': ['off', {
75
- paths: [],
76
- patterns: []
77
- }],
78
-
79
- // disallow to use this/super before super() calling in constructors.
80
- // https://eslint.org/docs/rules/no-this-before-super
81
- 'no-this-before-super': 'error',
82
-
83
- // disallow useless computed property keys
84
- // https://eslint.org/docs/rules/no-useless-computed-key
85
- 'no-useless-computed-key': 'error',
86
-
87
- // disallow unnecessary constructor
88
- // https://eslint.org/docs/rules/no-useless-constructor
89
- 'no-useless-constructor': 'error',
90
-
91
- // disallow renaming import, export, and destructured assignments to the same name
92
- // https://eslint.org/docs/rules/no-useless-rename
93
- 'no-useless-rename': ['error', {
94
- ignoreDestructuring: false,
95
- ignoreImport: false,
96
- ignoreExport: false,
97
- }],
98
-
99
- // require let or const instead of var
100
- 'no-var': 'error',
101
-
102
- // require method and property shorthand syntax for object literals
103
- // https://eslint.org/docs/rules/object-shorthand
104
- 'object-shorthand': ['error', 'always', {
105
- ignoreConstructors: false,
106
- avoidQuotes: true,
107
- }],
108
-
109
- // suggest using arrow functions as callbacks
110
- 'prefer-arrow-callback': ['error', {
111
- allowNamedFunctions: false,
112
- allowUnboundThis: true,
113
- }],
114
-
115
- // suggest using of const declaration for variables that are never modified after declared
116
- 'prefer-const': ['error', {
117
- destructuring: 'any',
118
- ignoreReadBeforeAssign: true,
119
- }],
120
-
121
- // Prefer destructuring from arrays and objects
122
- // https://eslint.org/docs/rules/prefer-destructuring
123
- 'prefer-destructuring': ['error', {
124
- VariableDeclarator: {
125
- array: false,
126
- object: true,
127
- },
128
- AssignmentExpression: {
129
- array: true,
130
- object: false,
131
- },
132
- }, {
133
- enforceForRenamedProperties: false,
134
- }],
135
-
136
- // disallow parseInt() in favor of binary, octal, and hexadecimal literals
137
- // https://eslint.org/docs/rules/prefer-numeric-literals
138
- 'prefer-numeric-literals': 'error',
139
-
140
- // suggest using Reflect methods where applicable
141
- // https://eslint.org/docs/rules/prefer-reflect
142
- 'prefer-reflect': 'off',
143
-
144
- // use rest parameters instead of arguments
145
- // https://eslint.org/docs/rules/prefer-rest-params
146
- 'prefer-rest-params': 'error',
147
-
148
- // suggest using the spread syntax instead of .apply()
149
- // https://eslint.org/docs/rules/prefer-spread
150
- 'prefer-spread': 'error',
151
-
152
- // suggest using template literals instead of string concatenation
153
- // https://eslint.org/docs/rules/prefer-template
154
- 'prefer-template': 'error',
155
-
156
- // disallow generator functions that do not have yield
157
- // https://eslint.org/docs/rules/require-yield
158
- 'require-yield': 'error',
159
-
160
- // enforce spacing between object rest-spread
161
- // https://eslint.org/docs/rules/rest-spread-spacing
162
- 'rest-spread-spacing': ['error', 'never'],
163
-
164
- // import sorting
165
- // https://eslint.org/docs/rules/sort-imports
166
- 'sort-imports': ['off', {
167
- ignoreCase: false,
168
- ignoreDeclarationSort: false,
169
- ignoreMemberSort: false,
170
- memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
171
- }],
172
-
173
- // require a Symbol description
174
- // https://eslint.org/docs/rules/symbol-description
175
- 'symbol-description': 'error',
176
-
177
- // enforce usage of spacing in template strings
178
- // https://eslint.org/docs/rules/template-curly-spacing
179
- 'template-curly-spacing': 'error',
180
-
181
- // enforce spacing around the * in yield* expressions
182
- // https://eslint.org/docs/rules/yield-star-spacing
183
- 'yield-star-spacing': ['error', 'after']
184
- }
185
- };
package/rules/imports.js DELETED
@@ -1,283 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es6: true
4
- },
5
- parserOptions: {
6
- ecmaVersion: 6,
7
- sourceType: 'module'
8
- },
9
- plugins: [
10
- 'import'
11
- ],
12
-
13
- settings: {
14
- 'import/resolver': {
15
- node: {
16
- extensions: ['.mjs', '.js', '.json']
17
- }
18
- },
19
- 'import/extensions': [
20
- '.js',
21
- '.mjs',
22
- '.jsx',
23
- ],
24
- 'import/core-modules': [
25
- ],
26
- 'import/ignore': [
27
- 'node_modules',
28
- '\\.(coffee|scss|css|less|hbs|svg|json)$',
29
- ],
30
- },
31
-
32
- rules: {
33
- // Static analysis:
34
-
35
- // ensure imports point to files/modules that can be resolved
36
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
37
- 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
38
-
39
- // ensure named imports coupled with named exports
40
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
41
- 'import/named': 'error',
42
-
43
- // ensure default import coupled with default export
44
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
45
- 'import/default': 'off',
46
-
47
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/namespace.md
48
- 'import/namespace': 'off',
49
-
50
- // Helpful warnings:
51
-
52
- // disallow invalid exports, e.g. multiple defaults
53
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/export.md
54
- 'import/export': 'error',
55
-
56
- // do not allow a default import name to match a named export
57
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
58
- 'import/no-named-as-default': 'error',
59
-
60
- // warn on accessing default export property names that are also named exports
61
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
62
- 'import/no-named-as-default-member': 'error',
63
-
64
- // disallow use of jsdoc-marked-deprecated imports
65
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
66
- 'import/no-deprecated': 'off',
67
-
68
- // Forbid the use of extraneous packages
69
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
70
- // paths are treated both as absolute paths, and relative to process.cwd()
71
- 'import/no-extraneous-dependencies': ['error', {
72
- devDependencies: [
73
- 'test/**', // tape, common npm pattern
74
- 'tests/**', // also common npm pattern
75
- 'spec/**', // mocha, rspec-like pattern
76
- '**/__tests__/**', // jest pattern
77
- '**/__mocks__/**', // jest pattern
78
- 'test.{js,jsx}', // repos with a single test file
79
- 'test-*.{js,jsx}', // repos with multiple top-level test files
80
- '**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
81
- '**/jest.config.js', // jest config
82
- '**/jest.setup.js', // jest setup
83
- '**/vue.config.js', // vue-cli config
84
- '**/webpack.config.js', // webpack config
85
- '**/webpack.config.*.js', // webpack config
86
- '**/rollup.config.js', // rollup config
87
- '**/rollup.config.*.js', // rollup config
88
- '**/gulpfile.js', // gulp config
89
- '**/gulpfile.*.js', // gulp config
90
- '**/Gruntfile{,.js}', // grunt config
91
- '**/protractor.conf.js', // protractor config
92
- '**/protractor.conf.*.js', // protractor config
93
- '**/karma.conf.js', // karma config
94
- '**/.eslintrc.js' // eslint config
95
- ],
96
- optionalDependencies: false,
97
- }],
98
-
99
- // Forbid mutable exports
100
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
101
- 'import/no-mutable-exports': 'error',
102
-
103
- // Module systems:
104
-
105
- // disallow require()
106
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
107
- 'import/no-commonjs': 'off',
108
-
109
- // disallow AMD require/define
110
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
111
- 'import/no-amd': 'error',
112
-
113
- // No Node.js builtin modules
114
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
115
- // TODO: enable?
116
- 'import/no-nodejs-modules': 'off',
117
-
118
- // Style guide:
119
-
120
- // disallow non-import statements appearing before import statements
121
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
122
- 'import/first': 'error',
123
-
124
- // disallow non-import statements appearing before import statements
125
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/imports-first.md
126
- // deprecated: use `import/first`
127
- 'import/imports-first': 'off',
128
-
129
- // disallow duplicate imports
130
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
131
- 'import/no-duplicates': 'error',
132
-
133
- // disallow namespace imports
134
- // TODO: enable?
135
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
136
- 'import/no-namespace': 'off',
137
-
138
- // Ensure consistent use of file extension within the import path
139
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/extensions.md
140
- 'import/extensions': ['error', 'ignorePackages', {
141
- js: 'never',
142
- mjs: 'never',
143
- jsx: 'never',
144
- }],
145
-
146
- // ensure absolute imports are above relative imports and that unassigned imports are ignored
147
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md
148
- // TODO: enforce a stricter convention in module import order?
149
- 'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
150
-
151
- // Require a newline after the last import/require in a group
152
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
153
- 'import/newline-after-import': 'error',
154
-
155
- // Require modules with a single export to use a default export
156
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
157
- 'import/prefer-default-export': 'error',
158
-
159
- // Restrict which files can be imported in a given folder
160
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
161
- 'import/no-restricted-paths': 'off',
162
-
163
- // Forbid modules to have too many dependencies
164
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
165
- 'import/max-dependencies': ['off', { max: 10 }],
166
-
167
- // Forbid import of modules using absolute paths
168
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
169
- 'import/no-absolute-path': 'error',
170
-
171
- // Forbid require() calls with expressions
172
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
173
- 'import/no-dynamic-require': 'error',
174
-
175
- // prevent importing the submodules of other modules
176
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
177
- 'import/no-internal-modules': ['off', {
178
- allow: [],
179
- }],
180
-
181
- // Warn if a module could be mistakenly parsed as a script by a consumer
182
- // leveraging Unambiguous JavaScript Grammar
183
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
184
- // this should not be enabled until this proposal has at least been *presented* to TC39.
185
- // At the moment, it's not a thing.
186
- 'import/unambiguous': 'off',
187
-
188
- // Forbid Webpack loader syntax in imports
189
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
190
- 'import/no-webpack-loader-syntax': 'error',
191
-
192
- // Prevent unassigned imports
193
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
194
- // importing for side effects is perfectly acceptable, if you need side effects.
195
- 'import/no-unassigned-import': 'off',
196
-
197
- // Prevent importing the default as if it were named
198
- // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
199
- 'import/no-named-default': 'error',
200
-
201
- // Reports if a module's default export is unnamed
202
- // https://github.com/import-js/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
203
- 'import/no-anonymous-default-export': ['off', {
204
- allowArray: false,
205
- allowArrowFunction: false,
206
- allowAnonymousClass: false,
207
- allowAnonymousFunction: false,
208
- allowLiteral: false,
209
- allowObject: false,
210
- }],
211
-
212
- // This rule enforces that all exports are declared at the bottom of the file.
213
- // https://github.com/import-js/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
214
- // TODO: enable?
215
- 'import/exports-last': 'off',
216
-
217
- // Reports when named exports are not grouped together in a single export declaration
218
- // or when multiple assignments to CommonJS module.exports or exports object are present
219
- // in a single file.
220
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
221
- 'import/group-exports': 'off',
222
-
223
- // forbid default exports. this is a terrible rule, do not use it.
224
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
225
- 'import/no-default-export': 'off',
226
-
227
- // Prohibit named exports. this is a terrible rule, do not use it.
228
- // https://github.com/import-js/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
229
- 'import/no-named-export': 'off',
230
-
231
- // Forbid a module from importing itself
232
- // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
233
- 'import/no-self-import': 'error',
234
-
235
- // Forbid cyclical dependencies between modules
236
- // https://github.com/import-js/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
237
- 'import/no-cycle': ['error', { maxDepth: '∞' }],
238
-
239
- // Ensures that there are no useless path segments
240
- // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
241
- 'import/no-useless-path-segments': ['error', { commonjs: true }],
242
-
243
- // dynamic imports require a leading comment with a webpackChunkName
244
- // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
245
- 'import/dynamic-import-chunkname': ['off', {
246
- importFunctions: [],
247
- webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
248
- }],
249
-
250
- // Use this rule to prevent imports to folders in relative parent paths.
251
- // https://github.com/import-js/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
252
- 'import/no-relative-parent-imports': 'off',
253
-
254
- // Reports modules without any exports, or with unused exports
255
- // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
256
- // TODO: enable once it supports CJS
257
- 'import/no-unused-modules': ['off', {
258
- ignoreExports: [],
259
- missingExports: true,
260
- unusedExports: true,
261
- }],
262
-
263
- // Reports the use of import declarations with CommonJS exports in any module except for the main module.
264
- // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md
265
- 'import/no-import-module-exports': ['error', {
266
- exceptions: [],
267
- }],
268
-
269
- // Use this rule to prevent importing packages through relative paths.
270
- // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md
271
- 'import/no-relative-packages': 'error',
272
-
273
- // enforce a consistent style for type specifiers (inline or top-level)
274
- // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/consistent-type-specifier-style.md
275
- // TODO, semver-major: enable (just in case)
276
- 'import/consistent-type-specifier-style': ['off', 'prefer-inline'],
277
-
278
- // Reports the use of empty named import blocks.
279
- // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md
280
- // TODO, semver-minor: enable
281
- 'import/no-empty-named-blocks': 'off',
282
- },
283
- };
package/rules/node.js DELETED
@@ -1,43 +0,0 @@
1
- module.exports = {
2
- env: {
3
- node: true
4
- },
5
-
6
- rules: {
7
- // enforce return after a callback
8
- 'callback-return': 'off',
9
-
10
- // require all requires be top-level
11
- // https://eslint.org/docs/rules/global-require
12
- 'global-require': 'error',
13
-
14
- // enforces error handling in callbacks (node environment)
15
- 'handle-callback-err': 'off',
16
-
17
- // disallow use of the Buffer() constructor
18
- // https://eslint.org/docs/rules/no-buffer-constructor
19
- 'no-buffer-constructor': 'error',
20
-
21
- // disallow mixing regular variable and require declarations
22
- 'no-mixed-requires': ['off', false],
23
-
24
- // disallow use of new operator with the require function
25
- 'no-new-require': 'error',
26
-
27
- // disallow string concatenation with __dirname and __filename
28
- // https://eslint.org/docs/rules/no-path-concat
29
- 'no-path-concat': 'error',
30
-
31
- // disallow use of process.env
32
- 'no-process-env': 'off',
33
-
34
- // disallow process.exit()
35
- 'no-process-exit': 'off',
36
-
37
- // restrict usage of specified node modules
38
- 'no-restricted-modules': 'off',
39
-
40
- // disallow use of synchronous methods (off by default)
41
- 'no-sync': 'off',
42
- }
43
- };
package/rules/strict.js DELETED
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- // babel inserts `'use strict';` for us
4
- strict: ['error', 'never']
5
- }
6
- };