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