eslint-config-airbnb-extended 1.0.10 → 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 (33) hide show
  1. package/dist/@types/legacy.d.ts +12 -0
  2. package/dist/helpers/getDevDepsList.js +1 -0
  3. package/dist/legacy/configs/base/config.js +24 -0
  4. package/dist/legacy/configs/base/index.js +18 -0
  5. package/dist/legacy/configs/base/legacy.js +46 -0
  6. package/dist/legacy/configs/base/recommended.js +21 -0
  7. package/dist/legacy/configs/base/typescript.js +8 -0
  8. package/dist/legacy/configs/index.js +15 -0
  9. package/dist/legacy/configs/react/base.js +8 -0
  10. package/dist/legacy/configs/react/config.js +14 -0
  11. package/dist/legacy/configs/react/hooks.js +8 -0
  12. package/dist/legacy/configs/react/index.js +24 -0
  13. package/dist/legacy/configs/react/legacy.js +8 -0
  14. package/dist/legacy/configs/react/recommended.js +13 -0
  15. package/dist/legacy/configs/react/typescript.js +35 -0
  16. package/dist/legacy/configs/typescript/config.js +12 -0
  17. package/dist/legacy/rules/best-practices.js +433 -0
  18. package/dist/legacy/rules/errors.js +167 -0
  19. package/dist/legacy/rules/es6.js +206 -0
  20. package/dist/legacy/rules/imports.js +280 -0
  21. package/dist/legacy/rules/index.js +18 -0
  22. package/dist/legacy/rules/node.js +35 -0
  23. package/dist/legacy/rules/react/react.js +663 -0
  24. package/dist/legacy/rules/react/reactHooks.js +30 -0
  25. package/dist/legacy/rules/react/reactJsxA11y.js +276 -0
  26. package/dist/legacy/rules/strict.js +12 -0
  27. package/dist/legacy/rules/style.js +655 -0
  28. package/dist/legacy/rules/typescript/typescript.js +251 -0
  29. package/dist/legacy/rules/typescript/typescriptOverrides.js +36 -0
  30. package/dist/legacy/rules/variables.js +68 -0
  31. package/dist/legacy.js +14 -0
  32. package/dist/rules/typescript/typescriptEslint.js +3 -0
  33. package/package.json +25 -10
@@ -0,0 +1,251 @@
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 typescript_eslint_1 = require("typescript-eslint");
7
+ const best_practices_1 = __importDefault(require("../../../legacy/rules/best-practices"));
8
+ const errors_1 = __importDefault(require("../../../legacy/rules/errors"));
9
+ const es6_1 = __importDefault(require("../../../legacy/rules/es6"));
10
+ const imports_1 = __importDefault(require("../../../legacy/rules/imports"));
11
+ const style_1 = __importDefault(require("../../../legacy/rules/style"));
12
+ const variables_1 = __importDefault(require("../../../legacy/rules/variables"));
13
+ const utils_1 = require("../../../utils");
14
+ const { rules: baseBestPracticesRules } = best_practices_1.default;
15
+ const { rules: baseErrorsRules } = errors_1.default;
16
+ const { rules: baseES6Rules } = es6_1.default;
17
+ const { rules: baseImportsRules } = imports_1.default;
18
+ const { rules: baseStyleRules } = style_1.default;
19
+ const { rules: baseVariablesRules } = variables_1.default;
20
+ const legacyTypescriptBaseRules = {
21
+ name: 'airbnb/config/typescript/legacy',
22
+ files: utils_1.tsFiles,
23
+ plugins: {
24
+ '@typescript-eslint': typescript_eslint_1.plugin,
25
+ },
26
+ languageOptions: {
27
+ parser: typescript_eslint_1.parser,
28
+ parserOptions: {
29
+ projectService: true,
30
+ },
31
+ },
32
+ settings: {
33
+ // Apply special parsing for TypeScript files
34
+ 'import/parsers': {
35
+ '@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
36
+ },
37
+ // Append 'ts' extensions to Airbnb 'import/resolver' setting
38
+ // Original: ['.mjs', '.js', '.json']
39
+ 'import/resolver': {
40
+ typescript: true,
41
+ node: true,
42
+ },
43
+ // Append 'ts' extensions to Airbnb 'import/extensions' setting
44
+ // Original: ['.js', '.mjs', '.jsx']
45
+ 'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.tsx', '.d.ts'],
46
+ // Resolve type definition packages
47
+ 'import/external-module-folders': ['node_modules', 'node_modules/@types'],
48
+ },
49
+ rules: {
50
+ // Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
51
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
52
+ // @deprecated and deleted by @typescript-eslint
53
+ // 'brace-style': 'off',
54
+ // '@typescript-eslint/brace-style': baseStyleRules['brace-style'],
55
+ // Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
56
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
57
+ camelcase: 'off',
58
+ // The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
59
+ '@typescript-eslint/naming-convention': [
60
+ 'error',
61
+ // Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10)
62
+ {
63
+ selector: 'variable',
64
+ format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
65
+ },
66
+ // Allow camelCase functions (23.2), and PascalCase functions (23.8)
67
+ {
68
+ selector: 'function',
69
+ format: ['camelCase', 'PascalCase'],
70
+ },
71
+ // Airbnb recommends PascalCase for classes (23.3), and although Airbnb does not make TypeScript recommendations, we are assuming this rule would similarly apply to anything "type like", including interfaces, type aliases, and enums
72
+ {
73
+ selector: 'typeLike',
74
+ format: ['PascalCase'],
75
+ },
76
+ ],
77
+ // Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
78
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
79
+ // The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
80
+ // @deprecated and deleted by @typescript-eslint
81
+ // 'comma-dangle': 'off',
82
+ // '@typescript-eslint/comma-dangle': [
83
+ // baseStyleRules['comma-dangle'][0],
84
+ // {
85
+ // ...baseStyleRules['comma-dangle'][1],
86
+ // enums: baseStyleRules['comma-dangle'][1].arrays,
87
+ // generics: baseStyleRules['comma-dangle'][1].arrays,
88
+ // tuples: baseStyleRules['comma-dangle'][1].arrays,
89
+ // },
90
+ // ],
91
+ // Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
92
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
93
+ // @deprecated and deleted by @typescript-eslint
94
+ // 'comma-spacing': 'off',
95
+ // '@typescript-eslint/comma-spacing': baseStyleRules['comma-spacing'],
96
+ // Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
97
+ // https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
98
+ 'default-param-last': 'off',
99
+ '@typescript-eslint/default-param-last': baseBestPracticesRules['default-param-last'],
100
+ // Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
101
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
102
+ 'dot-notation': 'off',
103
+ '@typescript-eslint/dot-notation': baseBestPracticesRules['dot-notation'],
104
+ // Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
105
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
106
+ // @deprecated and deleted by @typescript-eslint
107
+ // 'func-call-spacing': 'off',
108
+ // '@typescript-eslint/func-call-spacing': baseStyleRules['func-call-spacing'],
109
+ // Replace Airbnb 'indent' rule with '@typescript-eslint' version
110
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
111
+ // @deprecated and deleted by @typescript-eslint
112
+ // indent: 'off',
113
+ // '@typescript-eslint/indent': baseStyleRules.indent,
114
+ // Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
115
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
116
+ // @deprecated and deleted by @typescript-eslint
117
+ // 'keyword-spacing': 'off',
118
+ // '@typescript-eslint/keyword-spacing': baseStyleRules['keyword-spacing'],
119
+ // Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
120
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
121
+ // @deprecated and deleted by @typescript-eslint
122
+ // 'lines-between-class-members': 'off',
123
+ // '@typescript-eslint/lines-between-class-members': baseStyleRules['lines-between-class-members'],
124
+ // Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
125
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
126
+ 'no-array-constructor': 'off',
127
+ '@typescript-eslint/no-array-constructor': baseStyleRules['no-array-constructor'],
128
+ // Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version
129
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
130
+ 'no-dupe-class-members': 'off',
131
+ '@typescript-eslint/no-dupe-class-members': baseES6Rules['no-dupe-class-members'],
132
+ // Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version
133
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
134
+ 'no-empty-function': 'off',
135
+ '@typescript-eslint/no-empty-function': baseBestPracticesRules['no-empty-function'],
136
+ // Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
137
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
138
+ 'no-extra-parens': 'off',
139
+ '@typescript-eslint/no-extra-parens': baseErrorsRules['no-extra-parens'],
140
+ // Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
141
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
142
+ // @deprecated and deleted by @typescript-eslint
143
+ // 'no-extra-semi': 'off',
144
+ // '@typescript-eslint/no-extra-semi': baseErrorsRules['no-extra-semi'],
145
+ // Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
146
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
147
+ 'no-implied-eval': 'off',
148
+ 'no-new-func': 'off',
149
+ '@typescript-eslint/no-implied-eval': baseBestPracticesRules['no-implied-eval'],
150
+ // Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version
151
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
152
+ 'no-loss-of-precision': 'off',
153
+ '@typescript-eslint/no-loss-of-precision': baseErrorsRules['no-loss-of-precision'],
154
+ // Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
155
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
156
+ 'no-loop-func': 'off',
157
+ '@typescript-eslint/no-loop-func': baseBestPracticesRules['no-loop-func'],
158
+ // Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version
159
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
160
+ 'no-magic-numbers': 'off',
161
+ '@typescript-eslint/no-magic-numbers': baseBestPracticesRules['no-magic-numbers'],
162
+ // Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version
163
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
164
+ 'no-redeclare': 'off',
165
+ '@typescript-eslint/no-redeclare': baseBestPracticesRules['no-redeclare'],
166
+ // Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version
167
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
168
+ 'no-shadow': 'off',
169
+ '@typescript-eslint/no-shadow': baseVariablesRules['no-shadow'],
170
+ // Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version
171
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md
172
+ // @deprecated and deleted by @typescript-eslint
173
+ // 'space-before-blocks': 'off',
174
+ // '@typescript-eslint/space-before-blocks': baseStyleRules['space-before-blocks'],
175
+ // Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
176
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
177
+ // @deprecated and deleted by @typescript-eslint
178
+ // 'no-throw-literal': 'off',
179
+ // '@typescript-eslint/no-throw-literal': baseBestPracticesRules['no-throw-literal'],
180
+ // Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
181
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
182
+ 'no-unused-expressions': 'off',
183
+ '@typescript-eslint/no-unused-expressions': baseBestPracticesRules['no-unused-expressions'],
184
+ // Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version
185
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
186
+ 'no-unused-vars': 'off',
187
+ '@typescript-eslint/no-unused-vars': baseVariablesRules['no-unused-vars'],
188
+ // Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version
189
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
190
+ 'no-use-before-define': 'off',
191
+ '@typescript-eslint/no-use-before-define': baseVariablesRules['no-use-before-define'],
192
+ // Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version
193
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
194
+ 'no-useless-constructor': 'off',
195
+ '@typescript-eslint/no-useless-constructor': baseES6Rules['no-useless-constructor'],
196
+ // Replace Airbnb 'quotes' rule with '@typescript-eslint' version
197
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
198
+ // @deprecated and deleted by @typescript-eslint
199
+ // quotes: 'off',
200
+ // '@typescript-eslint/quotes': baseStyleRules.quotes,
201
+ // Replace Airbnb 'semi' rule with '@typescript-eslint' version
202
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
203
+ // @deprecated and deleted by @typescript-eslint
204
+ // semi: 'off',
205
+ // '@typescript-eslint/semi': baseStyleRules.semi,
206
+ // Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
207
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
208
+ // @deprecated and deleted by @typescript-eslint
209
+ // 'space-before-function-paren': 'off',
210
+ // '@typescript-eslint/space-before-function-paren': baseStyleRules['space-before-function-paren'],
211
+ // Replace Airbnb 'require-await' rule with '@typescript-eslint' version
212
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
213
+ 'require-await': 'off',
214
+ '@typescript-eslint/require-await': baseBestPracticesRules['require-await'],
215
+ // Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
216
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
217
+ 'no-return-await': 'off',
218
+ '@typescript-eslint/return-await': [baseBestPracticesRules['no-return-await'], 'in-try-catch'],
219
+ // Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
220
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
221
+ // @deprecated and deleted by @typescript-eslint
222
+ // 'space-infix-ops': 'off',
223
+ // '@typescript-eslint/space-infix-ops': baseStyleRules['space-infix-ops'],
224
+ // Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version
225
+ // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md
226
+ // @deprecated and deleted by @typescript-eslint
227
+ // 'object-curly-spacing': 'off',
228
+ // '@typescript-eslint/object-curly-spacing': baseStyleRules['object-curly-spacing'],
229
+ // Append 'ts' and 'tsx' to Airbnb 'import/extensions' rule
230
+ // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
231
+ 'import/extensions': [
232
+ baseImportsRules['import/extensions'][0],
233
+ baseImportsRules['import/extensions'][1],
234
+ Object.assign(Object.assign({}, baseImportsRules['import/extensions'][2]), { ts: 'never', tsx: 'never' }),
235
+ ],
236
+ // Append 'ts' and 'tsx' extensions to Airbnb 'import/no-extraneous-dependencies' rule
237
+ // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
238
+ 'import/no-extraneous-dependencies': [
239
+ baseImportsRules['import/no-extraneous-dependencies'][0],
240
+ Object.assign(Object.assign({}, baseImportsRules['import/no-extraneous-dependencies'][1]), { devDependencies: baseImportsRules['import/no-extraneous-dependencies'][1].devDependencies.reduce((result, devDep) => {
241
+ const toAppend = [devDep];
242
+ const devDepWithTs = devDep.replaceAll(/\bjs(x?)\b/g, 'ts$1');
243
+ if (devDepWithTs !== devDep) {
244
+ toAppend.push(devDepWithTs);
245
+ }
246
+ return [...result, ...toAppend];
247
+ }, []) }),
248
+ ],
249
+ },
250
+ };
251
+ exports.default = legacyTypescriptBaseRules;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("../../../utils");
4
+ const legacyTypescriptOverridesRules = {
5
+ name: 'airbnb/config/typescript/overrides/legacy',
6
+ files: utils_1.tsFiles,
7
+ rules: {
8
+ // The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler
9
+ // Some of the rules also fail in TypeScript files, for example: https://github.com/typescript-eslint/typescript-eslint/issues/662#issuecomment-507081586
10
+ // Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts
11
+ 'constructor-super': 'off',
12
+ 'getter-return': 'off',
13
+ 'no-const-assign': 'off',
14
+ 'no-dupe-args': 'off',
15
+ 'no-dupe-class-members': 'off',
16
+ 'no-dupe-keys': 'off',
17
+ 'no-func-assign': 'off',
18
+ 'no-import-assign': 'off',
19
+ 'no-new-symbol': 'off',
20
+ 'no-obj-calls': 'off',
21
+ 'no-redeclare': 'off',
22
+ 'no-setter-return': 'off',
23
+ 'no-this-before-super': 'off',
24
+ 'no-undef': 'off',
25
+ 'no-unreachable': 'off',
26
+ 'no-unsafe-negation': 'off',
27
+ 'valid-typeof': 'off',
28
+ // The following rules are enabled in Airbnb config, but are recommended to be disabled within TypeScript projects
29
+ // See: https://github.com/typescript-eslint/typescript-eslint/blob/13583e65f5973da2a7ae8384493c5e00014db51b/docs/linting/TROUBLESHOOTING.md#eslint-plugin-import
30
+ 'import/named': 'off',
31
+ 'import/no-named-as-default-member': 'off',
32
+ // Disable `import/no-unresolved`, see README.md for details
33
+ 'import/no-unresolved': 'off',
34
+ },
35
+ };
36
+ exports.default = legacyTypescriptOverridesRules;
@@ -0,0 +1,68 @@
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 confusing_browser_globals_1 = __importDefault(require("confusing-browser-globals"));
7
+ const utils_1 = require("../../utils");
8
+ const legacyVariablesRules = {
9
+ name: 'airbnb/config/variables/legacy',
10
+ files: utils_1.allFiles,
11
+ rules: {
12
+ // enforce or disallow variable initializations at definition
13
+ 'init-declarations': 'off',
14
+ // disallow the catch clause parameter name being the same as a variable in the outer scope
15
+ 'no-catch-shadow': 'off',
16
+ // disallow deletion of variables
17
+ 'no-delete-var': 'error',
18
+ // disallow labels that share a name with a variable
19
+ // https://eslint.org/docs/rules/no-label-var
20
+ 'no-label-var': 'error',
21
+ // disallow specific globals
22
+ 'no-restricted-globals': [
23
+ 'error',
24
+ {
25
+ name: 'isFinite',
26
+ message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
27
+ },
28
+ {
29
+ name: 'isNaN',
30
+ message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
31
+ },
32
+ ...confusing_browser_globals_1.default.map((g) => ({
33
+ name: g,
34
+ message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
35
+ })),
36
+ ],
37
+ // disallow declaration of variables already declared in the outer scope
38
+ 'no-shadow': 'error',
39
+ // disallow shadowing of names such as arguments
40
+ 'no-shadow-restricted-names': 'error',
41
+ // disallow use of undeclared variables unless mentioned in a /*global */ block
42
+ 'no-undef': 'error',
43
+ // disallow use of undefined when initializing variables
44
+ 'no-undef-init': 'error',
45
+ // disallow use of undefined variable
46
+ // https://eslint.org/docs/rules/no-undefined
47
+ 'no-undefined': 'off',
48
+ // disallow declaration of variables that are not used in the code
49
+ 'no-unused-vars': [
50
+ 'error',
51
+ {
52
+ vars: 'all',
53
+ args: 'after-used',
54
+ ignoreRestSiblings: true,
55
+ },
56
+ ],
57
+ // disallow use of variables before they are defined
58
+ 'no-use-before-define': [
59
+ 'error',
60
+ {
61
+ functions: true,
62
+ classes: true,
63
+ variables: true,
64
+ },
65
+ ],
66
+ },
67
+ };
68
+ exports.default = legacyVariablesRules;
package/dist/legacy.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /* eslint-disable import-x/no-rename-default, unicorn/prefer-export-from */
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.configs = exports.rules = void 0;
8
+ const configs_1 = __importDefault(require("./legacy/configs"));
9
+ const rules_1 = __importDefault(require("./legacy/rules"));
10
+ /**
11
+ * Direct export isn't allowed, it will increase the size of d.ts
12
+ */
13
+ exports.rules = rules_1.default;
14
+ exports.configs = configs_1.default;
@@ -305,6 +305,9 @@ const typescriptEslintRules = {
305
305
  // Disallow unnecessary constraints on generic types.
306
306
  // https://typescript-eslint.io/rules/no-unnecessary-type-constraint
307
307
  '@typescript-eslint/no-unnecessary-type-constraint': 'error',
308
+ // Disallow conversion idioms when they do not change the type or value of the expression.
309
+ // https://typescript-eslint.io/rules/no-unnecessary-type-conversion
310
+ '@typescript-eslint/no-unnecessary-type-conversion': 'off',
308
311
  // Disallow type parameters that aren't used multiple times.
309
312
  // https://typescript-eslint.io/rules/no-unnecessary-type-parameters
310
313
  '@typescript-eslint/no-unnecessary-type-parameters': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-airbnb-extended",
3
- "version": "1.0.10",
3
+ "version": "2.0.0-beta-1",
4
4
  "description": "Eslint Airbnb Config Extended",
5
5
  "keywords": [
6
6
  "eslint",
@@ -28,21 +28,29 @@
28
28
  "license": "MIT",
29
29
  "author": "Nisharg Shah <nishargshah3101@gmail.com>",
30
30
  "type": "commonjs",
31
- "main": "dist/index.js",
32
- "types": "dist/@types/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "default": "./dist/index.js",
34
+ "types": "./dist/@types/index.d.ts"
35
+ },
36
+ "./legacy": {
37
+ "default": "./dist/legacy.js",
38
+ "types": "./dist/@types/legacy.d.ts"
39
+ }
40
+ },
33
41
  "dependencies": {
34
42
  "confusing-browser-globals": "^1.0.11",
35
- "globals": "^16.0.0"
43
+ "globals": "^16.2.0"
36
44
  },
37
45
  "devDependencies": {
38
46
  "@stylistic/eslint-plugin": "^3.1.0",
39
47
  "@types/confusing-browser-globals": "^1.0.3",
40
- "@types/node": "^22.15.2",
48
+ "@types/node": "^22.15.29",
41
49
  "rimraf": "^6.0.1",
42
- "tsc-alias": "^1.8.15",
43
- "tsx": "^4.19.3",
50
+ "tsc-alias": "^1.8.16",
51
+ "tsx": "^4.19.4",
44
52
  "typescript": "^5.8.3",
45
- "typescript-eslint": "^8.31.0"
53
+ "typescript-eslint": "^8.33.0"
46
54
  },
47
55
  "peerDependencies": {
48
56
  "@next/eslint-plugin-next": "15.x",
@@ -50,6 +58,7 @@
50
58
  "@types/eslint-plugin-jsx-a11y": "6.x",
51
59
  "eslint": "9.x",
52
60
  "eslint-import-resolver-typescript": "4.x",
61
+ "eslint-plugin-import": "2.x",
53
62
  "eslint-plugin-import-x": "4.x",
54
63
  "eslint-plugin-jsx-a11y": "6.x",
55
64
  "eslint-plugin-n": "17.x",
@@ -71,10 +80,16 @@
71
80
  "optional": false
72
81
  },
73
82
  "eslint-import-resolver-typescript": {
74
- "optional": false
83
+ "optional": true
84
+ },
85
+ "eslint-plugin-import": {
86
+ "optional": true
87
+ },
88
+ "eslint-plugin-import-x": {
89
+ "optional": true
75
90
  },
76
91
  "eslint-plugin-jsx-a11y": {
77
- "optional": false
92
+ "optional": true
78
93
  },
79
94
  "eslint-plugin-n": {
80
95
  "optional": true