eslint-config-airbnb-extended 0.0.1 → 0.0.3

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.
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ // @ts-expect-error no @types package in DefinitelyTyped for below
22
+ var eslint_plugin_import_1 = __importDefault(require("eslint-plugin-import"));
23
+ var globals_1 = __importDefault(require("globals"));
24
+ exports.default = {
25
+ name: 'airbnb/config/imports',
26
+ languageOptions: {
27
+ globals: __assign({}, globals_1.default.es2015),
28
+ parserOptions: {
29
+ ecmaVersion: 6,
30
+ sourceType: 'module',
31
+ },
32
+ },
33
+ plugins: {
34
+ import: eslint_plugin_import_1.default,
35
+ },
36
+ settings: {
37
+ 'import/resolver': {
38
+ node: {
39
+ extensions: ['.mjs', '.js', '.json'],
40
+ },
41
+ },
42
+ 'import/extensions': ['.js', '.mjs', '.jsx'],
43
+ 'import/core-modules': [],
44
+ 'import/ignore': ['node_modules', String.raw(templateObject_1 || (templateObject_1 = __makeTemplateObject([".(coffee|scss|css|less|hbs|svg|json)$"], ["\\.(coffee|scss|css|less|hbs|svg|json)$"])))],
45
+ },
46
+ rules: {
47
+ // Static analysis:
48
+ // ensure imports point to files/modules that can be resolved
49
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md
50
+ 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
51
+ // ensure named imports coupled with named exports
52
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/named.md#when-not-to-use-it
53
+ 'import/named': 'error',
54
+ // ensure default import coupled with default export
55
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/default.md#when-not-to-use-it
56
+ 'import/default': 'off',
57
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/namespace.md
58
+ 'import/namespace': 'off',
59
+ // Helpful warnings:
60
+ // disallow invalid exports, e.g. multiple defaults
61
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/export.md
62
+ 'import/export': 'error',
63
+ // do not allow a default import name to match a named export
64
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default.md
65
+ 'import/no-named-as-default': 'error',
66
+ // warn on accessing default export property names that are also named exports
67
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-as-default-member.md
68
+ 'import/no-named-as-default-member': 'error',
69
+ // disallow use of jsdoc-marked-deprecated imports
70
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-deprecated.md
71
+ 'import/no-deprecated': 'off',
72
+ // Forbid the use of extraneous packages
73
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
74
+ // paths are treated both as absolute paths, and relative to process.cwd()
75
+ 'import/no-extraneous-dependencies': [
76
+ 'error',
77
+ {
78
+ devDependencies: [
79
+ 'test/**', // tape, common npm pattern
80
+ 'tests/**', // also common npm pattern
81
+ 'spec/**', // mocha, rspec-like pattern
82
+ '**/__tests__/**', // jest pattern
83
+ '**/__mocks__/**', // jest pattern
84
+ 'test.{js,jsx}', // repos with a single test file
85
+ 'test-*.{js,jsx}', // repos with multiple top-level test files
86
+ '**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
87
+ '**/jest.config.js', // jest config
88
+ '**/jest.setup.js', // jest setup
89
+ '**/vue.config.js', // vue-cli config
90
+ '**/webpack.config.js', // webpack config
91
+ '**/webpack.config.*.js', // webpack config
92
+ '**/rollup.config.js', // rollup config
93
+ '**/rollup.config.*.js', // rollup config
94
+ '**/gulpfile.js', // gulp config
95
+ '**/gulpfile.*.js', // gulp config
96
+ '**/Gruntfile{,.js}', // grunt config
97
+ '**/protractor.conf.js', // protractor config
98
+ '**/protractor.conf.*.js', // protractor config
99
+ '**/karma.conf.js', // karma config
100
+ '**/.eslintrc.js', // eslint config
101
+ ],
102
+ optionalDependencies: false,
103
+ },
104
+ ],
105
+ // Forbid mutable exports
106
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-mutable-exports.md
107
+ 'import/no-mutable-exports': 'error',
108
+ // Module systems:
109
+ // disallow require()
110
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-commonjs.md
111
+ 'import/no-commonjs': 'off',
112
+ // disallow AMD require/define
113
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-amd.md
114
+ 'import/no-amd': 'error',
115
+ // No Node.js builtin modules
116
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-nodejs-modules.md
117
+ // TODO: enable?
118
+ 'import/no-nodejs-modules': 'off',
119
+ // Style guide:
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
+ // disallow non-import statements appearing before import statements
124
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/imports-first.md
125
+ // deprecated: use `import/first`
126
+ 'import/imports-first': 'off',
127
+ // disallow duplicate imports
128
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
129
+ 'import/no-duplicates': 'error',
130
+ // disallow namespace imports
131
+ // TODO: enable?
132
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-namespace.md
133
+ 'import/no-namespace': 'off',
134
+ // Ensure consistent use of file extension within the import path
135
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/extensions.md
136
+ 'import/extensions': [
137
+ 'error',
138
+ 'ignorePackages',
139
+ {
140
+ js: 'never',
141
+ mjs: 'never',
142
+ jsx: 'never',
143
+ },
144
+ ],
145
+ // ensure absolute imports are above relative imports and that unassigned imports are ignored
146
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md
147
+ // TODO: enforce a stricter convention in module import order?
148
+ 'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
149
+ // Require a newline after the last import/require in a group
150
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md
151
+ 'import/newline-after-import': 'error',
152
+ // Require modules with a single export to use a default export
153
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md
154
+ 'import/prefer-default-export': 'error',
155
+ // Restrict which files can be imported in a given folder
156
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md
157
+ 'import/no-restricted-paths': 'off',
158
+ // Forbid modules to have too many dependencies
159
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/max-dependencies.md
160
+ 'import/max-dependencies': ['off', { max: 10 }],
161
+ // Forbid import of modules using absolute paths
162
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md
163
+ 'import/no-absolute-path': 'error',
164
+ // Forbid require() calls with expressions
165
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-dynamic-require.md
166
+ 'import/no-dynamic-require': 'error',
167
+ // prevent importing the submodules of other modules
168
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-internal-modules.md
169
+ 'import/no-internal-modules': [
170
+ 'off',
171
+ {
172
+ allow: [],
173
+ },
174
+ ],
175
+ // Warn if a module could be mistakenly parsed as a script by a consumer
176
+ // leveraging Unambiguous JavaScript Grammar
177
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/unambiguous.md
178
+ // this should not be enabled until this proposal has at least been *presented* to TC39.
179
+ // At the moment, it's not a thing.
180
+ 'import/unambiguous': 'off',
181
+ // Forbid Webpack loader syntax in imports
182
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-webpack-loader-syntax.md
183
+ 'import/no-webpack-loader-syntax': 'error',
184
+ // Prevent unassigned imports
185
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-unassigned-import.md
186
+ // importing for side effects is perfectly acceptable, if you need side effects.
187
+ 'import/no-unassigned-import': 'off',
188
+ // Prevent importing the default as if it were named
189
+ // https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-named-default.md
190
+ 'import/no-named-default': 'error',
191
+ // Reports if a module's default export is unnamed
192
+ // https://github.com/import-js/eslint-plugin-import/blob/d9b712ac7fd1fddc391f7b234827925c160d956f/docs/rules/no-anonymous-default-export.md
193
+ 'import/no-anonymous-default-export': [
194
+ 'off',
195
+ {
196
+ allowArray: false,
197
+ allowArrowFunction: false,
198
+ allowAnonymousClass: false,
199
+ allowAnonymousFunction: false,
200
+ allowLiteral: false,
201
+ allowObject: false,
202
+ },
203
+ ],
204
+ // This rule enforces that all exports are declared at the bottom of the file.
205
+ // https://github.com/import-js/eslint-plugin-import/blob/98acd6afd04dcb6920b81330114e146dc8532ea4/docs/rules/exports-last.md
206
+ // TODO: enable?
207
+ 'import/exports-last': 'off',
208
+ // Reports when named exports are not grouped together in a single export declaration
209
+ // or when multiple assignments to CommonJS module.exports or exports object are present
210
+ // in a single file.
211
+ // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/group-exports.md
212
+ 'import/group-exports': 'off',
213
+ // forbid default exports. this is a terrible rule, do not use it.
214
+ // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-default-export.md
215
+ 'import/no-default-export': 'off',
216
+ // Prohibit named exports. this is a terrible rule, do not use it.
217
+ // https://github.com/import-js/eslint-plugin-import/blob/1ec80fa35fa1819e2d35a70e68fb6a149fb57c5e/docs/rules/no-named-export.md
218
+ 'import/no-named-export': 'off',
219
+ // Forbid a module from importing itself
220
+ // https://github.com/import-js/eslint-plugin-import/blob/44a038c06487964394b1e15b64f3bd34e5d40cde/docs/rules/no-self-import.md
221
+ 'import/no-self-import': 'error',
222
+ // Forbid cyclical dependencies between modules
223
+ // https://github.com/import-js/eslint-plugin-import/blob/d81f48a2506182738409805f5272eff4d77c9348/docs/rules/no-cycle.md
224
+ 'import/no-cycle': ['error', { maxDepth: '∞' }],
225
+ // Ensures that there are no useless path segments
226
+ // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/no-useless-path-segments.md
227
+ 'import/no-useless-path-segments': ['error', { commonjs: true }],
228
+ // dynamic imports require a leading comment with a webpackChunkName
229
+ // https://github.com/import-js/eslint-plugin-import/blob/ebafcbf59ec9f653b2ac2a0156ca3bcba0a7cf57/docs/rules/dynamic-import-chunkname.md
230
+ 'import/dynamic-import-chunkname': [
231
+ 'off',
232
+ {
233
+ importFunctions: [],
234
+ webpackChunknameFormat: '[0-9a-zA-Z-_/.]+',
235
+ },
236
+ ],
237
+ // Use this rule to prevent imports to folders in relative parent paths.
238
+ // https://github.com/import-js/eslint-plugin-import/blob/c34f14f67f077acd5a61b3da9c0b0de298d20059/docs/rules/no-relative-parent-imports.md
239
+ 'import/no-relative-parent-imports': 'off',
240
+ // Reports modules without any exports, or with unused exports
241
+ // https://github.com/import-js/eslint-plugin-import/blob/f63dd261809de6883b13b6b5b960e6d7f42a7813/docs/rules/no-unused-modules.md
242
+ // TODO: enable once it supports CJS
243
+ 'import/no-unused-modules': [
244
+ 'off',
245
+ {
246
+ ignoreExports: [],
247
+ missingExports: true,
248
+ unusedExports: true,
249
+ },
250
+ ],
251
+ // Reports the use of import declarations with CommonJS exports in any module except for the main module.
252
+ // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-import-module-exports.md
253
+ 'import/no-import-module-exports': [
254
+ 'error',
255
+ {
256
+ exceptions: [],
257
+ },
258
+ ],
259
+ // Use this rule to prevent importing packages through relative paths.
260
+ // https://github.com/import-js/eslint-plugin-import/blob/1012eb951767279ce3b540a4ec4f29236104bb5b/docs/rules/no-relative-packages.md
261
+ 'import/no-relative-packages': 'error',
262
+ // enforce a consistent style for type specifiers (inline or top-level)
263
+ // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/consistent-type-specifier-style.md
264
+ // TODO, semver-major: enable (just in case)
265
+ 'import/consistent-type-specifier-style': ['off', 'prefer-inline'],
266
+ // Reports the use of empty named import blocks.
267
+ // https://github.com/import-js/eslint-plugin-import/blob/d5fc8b670dc8e6903dbb7b0894452f60c03089f5/docs/rules/no-empty-named-blocks.md
268
+ // TODO, semver-minor: enable
269
+ 'import/no-empty-named-blocks': 'off',
270
+ },
271
+ };
272
+ var templateObject_1;
@@ -0,0 +1,90 @@
1
+ declare const _default: {
2
+ name: string;
3
+ languageOptions: {
4
+ globals: {
5
+ AbortController: false;
6
+ AbortSignal: false;
7
+ atob: false;
8
+ Blob: false;
9
+ BroadcastChannel: false;
10
+ btoa: false;
11
+ Buffer: false;
12
+ ByteLengthQueuingStrategy: false;
13
+ clearImmediate: false;
14
+ clearInterval: false;
15
+ clearTimeout: false;
16
+ CloseEvent: false;
17
+ CompressionStream: false;
18
+ console: false;
19
+ CountQueuingStrategy: false;
20
+ crypto: false;
21
+ Crypto: false;
22
+ CryptoKey: false;
23
+ CustomEvent: false;
24
+ DecompressionStream: false;
25
+ DOMException: false;
26
+ Event: false;
27
+ EventTarget: false;
28
+ fetch: false;
29
+ File: false;
30
+ FormData: false;
31
+ global: false;
32
+ Headers: false;
33
+ MessageChannel: false;
34
+ MessageEvent: false;
35
+ MessagePort: false;
36
+ navigator: false;
37
+ Navigator: false;
38
+ performance: false;
39
+ Performance: false;
40
+ PerformanceEntry: false;
41
+ PerformanceMark: false;
42
+ PerformanceMeasure: false;
43
+ PerformanceObserver: false;
44
+ PerformanceObserverEntryList: false;
45
+ PerformanceResourceTiming: false;
46
+ process: false;
47
+ queueMicrotask: false;
48
+ ReadableByteStreamController: false;
49
+ ReadableStream: false;
50
+ ReadableStreamBYOBReader: false;
51
+ ReadableStreamBYOBRequest: false;
52
+ ReadableStreamDefaultController: false;
53
+ ReadableStreamDefaultReader: false;
54
+ Request: false;
55
+ Response: false;
56
+ setImmediate: false;
57
+ setInterval: false;
58
+ setTimeout: false;
59
+ structuredClone: false;
60
+ SubtleCrypto: false;
61
+ TextDecoder: false;
62
+ TextDecoderStream: false;
63
+ TextEncoder: false;
64
+ TextEncoderStream: false;
65
+ TransformStream: false;
66
+ TransformStreamDefaultController: false;
67
+ URL: false;
68
+ URLSearchParams: false;
69
+ WebAssembly: false;
70
+ WebSocket: false;
71
+ WritableStream: false;
72
+ WritableStreamDefaultController: false;
73
+ WritableStreamDefaultWriter: false;
74
+ };
75
+ };
76
+ rules: {
77
+ 'callback-return': "off";
78
+ 'global-require': "error";
79
+ 'handle-callback-err': "off";
80
+ 'no-buffer-constructor': "error";
81
+ 'no-mixed-requires': ["off", boolean];
82
+ 'no-new-require': "error";
83
+ 'no-path-concat': "error";
84
+ 'no-process-env': "off";
85
+ 'no-process-exit': "off";
86
+ 'no-restricted-modules': "off";
87
+ 'no-sync': "off";
88
+ };
89
+ };
90
+ export default _default;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var globals_1 = __importDefault(require("globals"));
18
+ exports.default = {
19
+ name: 'airbnb/config/node',
20
+ languageOptions: {
21
+ globals: __assign({}, globals_1.default.nodeBuiltin),
22
+ },
23
+ rules: {
24
+ // enforce return after a callback
25
+ 'callback-return': 'off',
26
+ // require all requires be top-level
27
+ // https://eslint.org/docs/rules/global-require
28
+ 'global-require': 'error',
29
+ // enforces error handling in callbacks (node environment)
30
+ 'handle-callback-err': 'off',
31
+ // disallow use of the Buffer() constructor
32
+ // https://eslint.org/docs/rules/no-buffer-constructor
33
+ 'no-buffer-constructor': 'error',
34
+ // disallow mixing regular variable and require declarations
35
+ 'no-mixed-requires': ['off', false],
36
+ // disallow use of new operator with the require function
37
+ 'no-new-require': 'error',
38
+ // disallow string concatenation with __dirname and __filename
39
+ // https://eslint.org/docs/rules/no-path-concat
40
+ 'no-path-concat': 'error',
41
+ // disallow use of process.env
42
+ 'no-process-env': 'off',
43
+ // disallow process.exit()
44
+ 'no-process-exit': 'off',
45
+ // restrict usage of specified node modules
46
+ 'no-restricted-modules': 'off',
47
+ // disallow use of synchronous methods (off by default)
48
+ 'no-sync': 'off',
49
+ },
50
+ };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ name: string;
3
+ rules: {
4
+ strict: ["error", string];
5
+ };
6
+ };
7
+ export default _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ name: 'airbnb/config/strict',
5
+ rules: {
6
+ // babel inserts `'use strict';` for us
7
+ strict: ['error', 'never'],
8
+ },
9
+ };