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