@gitlab/eslint-plugin 21.2.0 → 21.2.1

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.
@@ -1,285 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es6: true,
4
- },
5
- parserOptions: {
6
- ecmaVersion: 6,
7
- sourceType: 'module',
8
- },
9
- plugins: ['import'],
10
-
11
- settings: {
12
- 'import/resolver': {
13
- node: {
14
- extensions: ['.mjs', '.js', '.json'],
15
- },
16
- },
17
- 'import/extensions': ['.js', '.mjs', '.jsx'],
18
- 'import/core-modules': [],
19
- 'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
20
- },
21
-
22
- rules: {
23
- // Static analysis:
24
-
25
- // ensure imports point to files/modules that can be resolved
26
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
27
- 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
28
-
29
- // ensure named imports coupled with named exports
30
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
31
- 'import/named': 'error',
32
-
33
- // ensure default import coupled with default export
34
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
35
- 'import/default': 'off',
36
-
37
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/namespace.md
38
- 'import/namespace': 'off',
39
-
40
- // Helpful warnings:
41
-
42
- // disallow invalid exports, e.g. multiple defaults
43
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/export.md
44
- 'import/export': 'error',
45
-
46
- // do not allow a default import name to match a named export
47
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
48
- 'import/no-named-as-default': 'error',
49
-
50
- // warn on accessing default export property names that are also named exports
51
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
52
- 'import/no-named-as-default-member': 'error',
53
-
54
- // disallow use of jsdoc-marked-deprecated imports
55
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
56
- 'import/no-deprecated': 'off',
57
-
58
- // Forbid the use of extraneous packages
59
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
60
- // paths are treated both as absolute paths, and relative to process.cwd()
61
- 'import/no-extraneous-dependencies': [
62
- 'error',
63
- {
64
- devDependencies: [
65
- 'test/**', // tape, common npm pattern
66
- 'tests/**', // also common npm pattern
67
- 'spec/**', // mocha, rspec-like pattern
68
- '**/__tests__/**', // jest pattern
69
- '**/__mocks__/**', // jest pattern
70
- 'test.{js,jsx}', // repos with a single test file
71
- 'test-*.{js,jsx}', // repos with multiple top-level test files
72
- '**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
73
- '**/jest.config.js', // jest config
74
- '**/jest.setup.js', // jest setup
75
- '**/vue.config.js', // vue-cli config
76
- '**/webpack.config.js', // webpack config
77
- '**/webpack.config.*.js', // webpack config
78
- '**/rollup.config.js', // rollup config
79
- '**/rollup.config.*.js', // rollup config
80
- '**/gulpfile.js', // gulp config
81
- '**/gulpfile.*.js', // gulp config
82
- '**/Gruntfile{,.js}', // grunt config
83
- '**/protractor.conf.js', // protractor config
84
- '**/protractor.conf.*.js', // protractor config
85
- '**/karma.conf.js', // karma config
86
- '**/.eslintrc.js', // eslint config
87
- ],
88
- optionalDependencies: false,
89
- },
90
- ],
91
-
92
- // Forbid mutable exports
93
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
94
- 'import/no-mutable-exports': 'error',
95
-
96
- // Module systems:
97
-
98
- // disallow require()
99
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
100
- 'import/no-commonjs': 'off',
101
-
102
- // disallow AMD require/define
103
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-amd.md
104
- 'import/no-amd': 'error',
105
-
106
- // No Node.js builtin modules
107
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
108
- // TODO: enable?
109
- 'import/no-nodejs-modules': 'off',
110
-
111
- // Style guide:
112
-
113
- // disallow non-import statements appearing before import statements
114
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/first.md
115
- 'import/first': 'error',
116
-
117
- // disallow non-import statements appearing before import statements
118
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/imports-first.md
119
- // deprecated: use `import/first`
120
- 'import/imports-first': 'off',
121
-
122
- // disallow duplicate imports
123
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
124
- 'import/no-duplicates': 'error',
125
-
126
- // disallow namespace imports
127
- // TODO: enable?
128
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
129
- 'import/no-namespace': 'off',
130
-
131
- // Ensure consistent use of file extension within the import path
132
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
133
- 'import/extensions': [
134
- 'error',
135
- 'ignorePackages',
136
- {
137
- js: 'never',
138
- mjs: 'never',
139
- jsx: 'never',
140
- },
141
- ],
142
-
143
- // ensure absolute imports are above relative imports and that unassigned imports are ignored
144
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
145
- // TODO: enforce a stricter convention in module import order?
146
- 'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
147
-
148
- // Require a newline after the last import/require in a group
149
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
150
- 'import/newline-after-import': 'error',
151
-
152
- // Require modules with a single export to use a default export
153
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
154
- 'import/prefer-default-export': 'error',
155
-
156
- // Restrict which files can be imported in a given folder
157
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
158
- 'import/no-restricted-paths': 'off',
159
-
160
- // Forbid modules to have too many dependencies
161
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
162
- 'import/max-dependencies': ['off', { max: 10 }],
163
-
164
- // Forbid import of modules using absolute paths
165
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
166
- 'import/no-absolute-path': 'error',
167
-
168
- // Forbid require() calls with expressions
169
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
170
- 'import/no-dynamic-require': 'error',
171
-
172
- // prevent importing the submodules of other modules
173
- // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
174
- 'import/no-internal-modules': [
175
- 'off',
176
- {
177
- allow: [],
178
- },
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/benmosher/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/benmosher/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/benmosher/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/benmosher/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/benmosher/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
203
- 'import/no-anonymous-default-export': [
204
- 'off',
205
- {
206
- allowArray: false,
207
- allowArrowFunction: false,
208
- allowAnonymousClass: false,
209
- allowAnonymousFunction: false,
210
- allowLiteral: false,
211
- allowObject: false,
212
- },
213
- ],
214
-
215
- // This rule enforces that all exports are declared at the bottom of the file.
216
- // https://github.com/benmosher/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
217
- // TODO: enable?
218
- 'import/exports-last': 'off',
219
-
220
- // Reports when named exports are not grouped together in a single export declaration
221
- // or when multiple assignments to CommonJS module.exports or exports object are present
222
- // in a single file.
223
- // https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
224
- 'import/group-exports': 'off',
225
-
226
- // forbid default exports. this is a terrible rule, do not use it.
227
- // https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
228
- 'import/no-default-export': 'off',
229
-
230
- // Prohibit named exports. this is a terrible rule, do not use it.
231
- // https://github.com/benmosher/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
232
- 'import/no-named-export': 'off',
233
-
234
- // Forbid a module from importing itself
235
- // https://github.com/benmosher/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
236
- 'import/no-self-import': 'error',
237
-
238
- // Forbid cyclical dependencies between modules
239
- // https://github.com/benmosher/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
240
- 'import/no-cycle': ['error', { maxDepth: '∞' }],
241
-
242
- // Ensures that there are no useless path segments
243
- // https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
244
- 'import/no-useless-path-segments': ['error', { commonjs: true }],
245
-
246
- // dynamic imports require a leading comment with a webpackChunkName
247
- // https://github.com/benmosher/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
248
- 'import/dynamic-import-chunkname': [
249
- 'off',
250
- {
251
- importFunctions: [],
252
- webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
253
- },
254
- ],
255
-
256
- // Use this rule to prevent imports to folders in relative parent paths.
257
- // https://github.com/benmosher/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
258
- 'import/no-relative-parent-imports': 'off',
259
-
260
- // Reports modules without any exports, or with unused exports
261
- // https://github.com/benmosher/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
262
- // TODO: enable once it supports CJS
263
- 'import/no-unused-modules': [
264
- 'off',
265
- {
266
- ignoreExports: [],
267
- missingExports: true,
268
- unusedExports: true,
269
- },
270
- ],
271
-
272
- // Reports the use of import declarations with CommonJS exports in any module except for the main module.
273
- // https://github.com/benmosher/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md
274
- 'import/no-import-module-exports': [
275
- 'error',
276
- {
277
- exceptions: [],
278
- },
279
- ],
280
-
281
- // Use this rule to prevent importing packages through relative paths.
282
- // https://github.com/benmosher/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md
283
- 'import/no-relative-packages': 'error',
284
- },
285
- };
@@ -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
- };
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- // babel inserts `'use strict';` for us
4
- strict: ['error', 'never'],
5
- },
6
- };