eslint-config-airbnb-extended 0.1.1 → 0.2.0
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.
- package/dist/base/index.d.ts +151 -2
- package/dist/base/recommended.d.ts +989 -1
- package/dist/helpers/getDevDepsList.d.ts +3 -0
- package/dist/helpers/getDevDepsList.js +31 -0
- package/dist/index.d.ts +14866 -1623
- package/dist/index.js +9 -1
- package/dist/react/index.d.ts +0 -5
- package/dist/react/recommended.d.ts +2785 -1
- package/dist/react/recommended.js +15 -1
- package/dist/rules/es6.js +1 -1
- package/dist/rules/imports.d.ts +69 -75
- package/dist/rules/imports.js +157 -210
- package/dist/rules/importsStrict.d.ts +43 -0
- package/dist/rules/importsStrict.js +74 -0
- package/dist/rules/next.d.ts +8 -0
- package/dist/rules/next.js +12 -0
- package/dist/rules/react.d.ts +0 -5
- package/dist/rules/react.js +0 -5
- package/dist/rules/typescript/typescriptBase.d.ts +23 -0
- package/dist/rules/typescript/typescriptBase.js +26 -0
- package/dist/rules/typescript/typescriptEslint.d.ts +3 -0
- package/dist/rules/typescript/typescriptEslint.js +184 -0
- package/dist/rules/typescript/typescriptImports.d.ts +37 -0
- package/dist/rules/typescript/typescriptImports.js +54 -0
- package/dist/rules/typescript.d.ts +45 -2
- package/dist/rules/typescript.js +4 -259
- package/dist/rules/variables.d.ts +1 -1
- package/dist/typescript/index.d.ts +54 -1
- package/dist/typescript/index.js +4 -2
- package/dist/typescript/recommended.d.ts +108 -2
- package/dist/typescript/recommended.js +17 -44
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +12 -0
- package/package.json +11 -3
package/dist/rules/typescript.js
CHANGED
|
@@ -3,262 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const es6_1 = __importDefault(require("../rules/es6"));
|
|
11
|
-
const imports_1 = require("../rules/imports");
|
|
12
|
-
const style_1 = __importDefault(require("../rules/style"));
|
|
13
|
-
const variables_1 = __importDefault(require("../rules/variables"));
|
|
14
|
-
exports.importResolverExtensions = [
|
|
15
|
-
...imports_1.importConfig.settings['import/resolver'].node.extensions,
|
|
16
|
-
'.ts',
|
|
17
|
-
'.cts',
|
|
18
|
-
'.mts',
|
|
19
|
-
'.d.ts',
|
|
20
|
-
];
|
|
21
|
-
exports.default = [
|
|
22
|
-
{
|
|
23
|
-
name: 'airbnb/config/typescript',
|
|
24
|
-
plugins: {
|
|
25
|
-
'@typescript-eslint': typescript_eslint_1.plugin,
|
|
26
|
-
},
|
|
27
|
-
languageOptions: {
|
|
28
|
-
parser: typescript_eslint_1.parser,
|
|
29
|
-
parserOptions: {
|
|
30
|
-
projectService: true,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
settings: {
|
|
34
|
-
// Append 'ts' extensions to Airbnb 'import/resolver' setting
|
|
35
|
-
'import/resolver': {
|
|
36
|
-
node: {
|
|
37
|
-
extensions: exports.importResolverExtensions,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
// Append 'ts' extensions to Airbnb 'import/extensions' setting
|
|
41
|
-
'import/extensions': [...imports_1.importConfig.settings['import/extensions'], '.ts', '.tsx', '.d.ts'],
|
|
42
|
-
// Resolve type definition packages
|
|
43
|
-
'import/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
44
|
-
},
|
|
45
|
-
rules: {
|
|
46
|
-
// Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
|
|
47
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
|
|
48
|
-
'brace-style': 'off',
|
|
49
|
-
'@typescript-eslint/brace-style': style_1.default.rules['brace-style'],
|
|
50
|
-
// Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
|
|
51
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
52
|
-
camelcase: 'off',
|
|
53
|
-
// The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
|
|
54
|
-
'@typescript-eslint/naming-convention': [
|
|
55
|
-
'error',
|
|
56
|
-
// Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10)
|
|
57
|
-
{
|
|
58
|
-
selector: 'variable',
|
|
59
|
-
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
60
|
-
},
|
|
61
|
-
// Allow camelCase functions (23.2), and PascalCase functions (23.8)
|
|
62
|
-
{
|
|
63
|
-
selector: 'function',
|
|
64
|
-
format: ['camelCase', 'PascalCase'],
|
|
65
|
-
},
|
|
66
|
-
// 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
|
|
67
|
-
{
|
|
68
|
-
selector: 'typeLike',
|
|
69
|
-
format: ['PascalCase'],
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
// Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
|
|
73
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
|
|
74
|
-
// The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
|
|
75
|
-
'comma-dangle': 'off',
|
|
76
|
-
'@typescript-eslint/comma-dangle': [
|
|
77
|
-
style_1.default.rules['comma-dangle'][0],
|
|
78
|
-
Object.assign(Object.assign({}, style_1.default.rules['comma-dangle'][1]), { enums: style_1.default.rules['comma-dangle'][1].arrays, generics: style_1.default.rules['comma-dangle'][1].arrays, tuples: style_1.default.rules['comma-dangle'][1].arrays }),
|
|
79
|
-
],
|
|
80
|
-
// Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
|
|
81
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
|
|
82
|
-
'comma-spacing': 'off',
|
|
83
|
-
'@typescript-eslint/comma-spacing': style_1.default.rules['comma-spacing'],
|
|
84
|
-
// Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
|
|
85
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
|
|
86
|
-
'default-param-last': 'off',
|
|
87
|
-
'@typescript-eslint/default-param-last': best_practices_1.default.rules['default-param-last'],
|
|
88
|
-
// Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
|
|
89
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
|
|
90
|
-
'dot-notation': 'off',
|
|
91
|
-
'@typescript-eslint/dot-notation': best_practices_1.default.rules['dot-notation'],
|
|
92
|
-
// Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
|
|
93
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
|
|
94
|
-
'func-call-spacing': 'off',
|
|
95
|
-
'@typescript-eslint/func-call-spacing': style_1.default.rules['func-call-spacing'],
|
|
96
|
-
// Replace Airbnb 'indent' rule with '@typescript-eslint' version
|
|
97
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
|
|
98
|
-
indent: 'off',
|
|
99
|
-
'@typescript-eslint/indent': style_1.default.rules.indent,
|
|
100
|
-
// Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
|
|
101
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
|
|
102
|
-
'keyword-spacing': 'off',
|
|
103
|
-
'@typescript-eslint/keyword-spacing': style_1.default.rules['keyword-spacing'],
|
|
104
|
-
// Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
|
|
105
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
|
|
106
|
-
'lines-between-class-members': 'off',
|
|
107
|
-
'@typescript-eslint/lines-between-class-members': style_1.default.rules['lines-between-class-members'],
|
|
108
|
-
// Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
|
|
109
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
|
|
110
|
-
'no-array-constructor': 'off',
|
|
111
|
-
'@typescript-eslint/no-array-constructor': style_1.default.rules['no-array-constructor'],
|
|
112
|
-
// Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version
|
|
113
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
|
|
114
|
-
'no-dupe-class-members': 'off',
|
|
115
|
-
'@typescript-eslint/no-dupe-class-members': es6_1.default.rules['no-dupe-class-members'],
|
|
116
|
-
// Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version
|
|
117
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
|
|
118
|
-
'no-empty-function': 'off',
|
|
119
|
-
'@typescript-eslint/no-empty-function': best_practices_1.default.rules['no-empty-function'],
|
|
120
|
-
// Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
|
|
121
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
|
|
122
|
-
'no-extra-parens': 'off',
|
|
123
|
-
'@typescript-eslint/no-extra-parens': errors_1.default.rules['no-extra-parens'],
|
|
124
|
-
// Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
|
|
125
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
|
|
126
|
-
'no-extra-semi': 'off',
|
|
127
|
-
'@typescript-eslint/no-extra-semi': errors_1.default.rules['no-extra-semi'],
|
|
128
|
-
// Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
|
|
129
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
|
|
130
|
-
'no-implied-eval': 'off',
|
|
131
|
-
'no-new-func': 'off',
|
|
132
|
-
'@typescript-eslint/no-implied-eval': best_practices_1.default.rules['no-implied-eval'],
|
|
133
|
-
// Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version
|
|
134
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
|
|
135
|
-
'no-loss-of-precision': 'off',
|
|
136
|
-
'@typescript-eslint/no-loss-of-precision': errors_1.default.rules['no-loss-of-precision'],
|
|
137
|
-
// Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
|
|
138
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
|
|
139
|
-
'no-loop-func': 'off',
|
|
140
|
-
'@typescript-eslint/no-loop-func': best_practices_1.default.rules['no-loop-func'],
|
|
141
|
-
// Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version
|
|
142
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
|
|
143
|
-
'no-magic-numbers': 'off',
|
|
144
|
-
'@typescript-eslint/no-magic-numbers': best_practices_1.default.rules['no-magic-numbers'],
|
|
145
|
-
// Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version
|
|
146
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
|
|
147
|
-
'no-redeclare': 'off',
|
|
148
|
-
'@typescript-eslint/no-redeclare': best_practices_1.default.rules['no-redeclare'],
|
|
149
|
-
// Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version
|
|
150
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
|
|
151
|
-
'no-shadow': 'off',
|
|
152
|
-
'@typescript-eslint/no-shadow': variables_1.default.rules['no-shadow'],
|
|
153
|
-
// Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version
|
|
154
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md
|
|
155
|
-
'space-before-blocks': 'off',
|
|
156
|
-
'@typescript-eslint/space-before-blocks': style_1.default.rules['space-before-blocks'],
|
|
157
|
-
// Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
|
|
158
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
|
|
159
|
-
'no-throw-literal': 'off',
|
|
160
|
-
'@typescript-eslint/no-throw-literal': best_practices_1.default.rules['no-throw-literal'],
|
|
161
|
-
// Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
|
|
162
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
163
|
-
'no-unused-expressions': 'off',
|
|
164
|
-
'@typescript-eslint/no-unused-expressions': best_practices_1.default.rules['no-unused-expressions'],
|
|
165
|
-
// Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version
|
|
166
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
|
|
167
|
-
'no-unused-vars': 'off',
|
|
168
|
-
'@typescript-eslint/no-unused-vars': variables_1.default.rules['no-unused-vars'],
|
|
169
|
-
// Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version
|
|
170
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
|
|
171
|
-
'no-use-before-define': 'off',
|
|
172
|
-
'@typescript-eslint/no-use-before-define': variables_1.default.rules['no-use-before-define'],
|
|
173
|
-
// Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version
|
|
174
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
|
|
175
|
-
'no-useless-constructor': 'off',
|
|
176
|
-
'@typescript-eslint/no-useless-constructor': es6_1.default.rules['no-useless-constructor'],
|
|
177
|
-
// Replace Airbnb 'quotes' rule with '@typescript-eslint' version
|
|
178
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
|
|
179
|
-
quotes: 'off',
|
|
180
|
-
'@typescript-eslint/quotes': style_1.default.rules.quotes,
|
|
181
|
-
// Replace Airbnb 'semi' rule with '@typescript-eslint' version
|
|
182
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
|
|
183
|
-
semi: 'off',
|
|
184
|
-
'@typescript-eslint/semi': style_1.default.rules.semi,
|
|
185
|
-
// Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
|
|
186
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
|
|
187
|
-
'space-before-function-paren': 'off',
|
|
188
|
-
'@typescript-eslint/space-before-function-paren': style_1.default.rules['space-before-function-paren'],
|
|
189
|
-
// Replace Airbnb 'require-await' rule with '@typescript-eslint' version
|
|
190
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
191
|
-
'require-await': 'off',
|
|
192
|
-
'@typescript-eslint/require-await': best_practices_1.default.rules['require-await'],
|
|
193
|
-
// Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
|
|
194
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
195
|
-
'no-return-await': 'off',
|
|
196
|
-
'@typescript-eslint/return-await': [best_practices_1.default.rules['no-return-await'], 'in-try-catch'],
|
|
197
|
-
// Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
|
|
198
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
|
|
199
|
-
'space-infix-ops': 'off',
|
|
200
|
-
'@typescript-eslint/space-infix-ops': style_1.default.rules['space-infix-ops'],
|
|
201
|
-
// Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version
|
|
202
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md
|
|
203
|
-
'object-curly-spacing': 'off',
|
|
204
|
-
'@typescript-eslint/object-curly-spacing': style_1.default.rules['object-curly-spacing'],
|
|
205
|
-
// Append 'ts' and 'tsx' to Airbnb 'import/extensions' rule
|
|
206
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
207
|
-
'import/extensions': [
|
|
208
|
-
imports_1.importConfig.rules['import/extensions'][0],
|
|
209
|
-
imports_1.importConfig.rules['import/extensions'][1],
|
|
210
|
-
Object.assign(Object.assign({}, imports_1.importConfig.rules['import/extensions'][2]), { ts: 'never', tsx: 'never' }),
|
|
211
|
-
],
|
|
212
|
-
// Append 'ts' and 'tsx' extensions to Airbnb 'import/no-extraneous-dependencies' rule
|
|
213
|
-
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
214
|
-
'import/no-extraneous-dependencies': [
|
|
215
|
-
imports_1.importConfig.rules['import/no-extraneous-dependencies'][0],
|
|
216
|
-
Object.assign(Object.assign({}, imports_1.importConfig.rules['import/no-extraneous-dependencies'][1]), { devDependencies: imports_1.importConfig.rules['import/no-extraneous-dependencies'][1].devDependencies.reduce((result, devDep) => {
|
|
217
|
-
const toAppend = [devDep];
|
|
218
|
-
const devDepWithTs = devDep.replaceAll(/\bjs(x?)\b/g, 'ts$1');
|
|
219
|
-
if (devDepWithTs !== devDep) {
|
|
220
|
-
toAppend.push(devDepWithTs);
|
|
221
|
-
}
|
|
222
|
-
return [...result, ...toAppend];
|
|
223
|
-
}, []) }),
|
|
224
|
-
],
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
name: 'airbnb/config/typescript-overrides',
|
|
229
|
-
files: ['*.ts', '*.tsx'],
|
|
230
|
-
rules: {
|
|
231
|
-
// The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler
|
|
232
|
-
// Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts
|
|
233
|
-
'constructor-super': 'off', // ts(2335) & ts(2377)
|
|
234
|
-
'getter-return': 'off', // ts(2378)
|
|
235
|
-
'no-class-assign': 'off', // ts(2629)
|
|
236
|
-
'no-const-assign': 'off', // ts(2588)
|
|
237
|
-
'no-dupe-args': 'off', // ts(2300)
|
|
238
|
-
'no-dupe-class-members': 'off', // ts(2393) & ts(2300)
|
|
239
|
-
'no-dupe-keys': 'off', // ts(1117)
|
|
240
|
-
'no-func-assign': 'off', // ts(2630)
|
|
241
|
-
'no-import-assign': 'off', // ts(2632) & ts(2540)
|
|
242
|
-
'no-new-native-nonconstructor': 'off', // ts(7009)
|
|
243
|
-
'no-obj-calls': 'off', // ts(2349)
|
|
244
|
-
'no-redeclare': 'off', // ts(2451)
|
|
245
|
-
'no-setter-return': 'off', // ts(2408)
|
|
246
|
-
'no-this-before-super': 'off', // ts(2376) & ts(17009)
|
|
247
|
-
'no-undef': 'off', // ts(2304) & ts(2552)
|
|
248
|
-
'no-unreachable': 'off', // ts(7027)
|
|
249
|
-
'no-unsafe-negation': 'off', // ts(2365) & ts(2322) & ts(2358)
|
|
250
|
-
'no-with': 'off', // ts(1101) & ts(2410)
|
|
251
|
-
'valid-typeof': 'off',
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: 'airbnb/config/typescript-import-overrides',
|
|
256
|
-
files: ['*.ts', '*.tsx'],
|
|
257
|
-
rules: {
|
|
258
|
-
// The following rules are enabled in Airbnb config, but are recommended to be disabled within TypeScript projects
|
|
259
|
-
// See: https://github.com/typescript-eslint/typescript-eslint/blob/13583e65f5973da2a7ae8384493c5e00014db51b/docs/linting/TROUBLESHOOTING.md#eslint-plugin-import
|
|
260
|
-
'import/named': 'off',
|
|
261
|
-
'import/no-named-as-default-member': 'off',
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
];
|
|
6
|
+
const typescriptBase_1 = __importDefault(require("../rules/typescript/typescriptBase"));
|
|
7
|
+
const typescriptEslint_1 = __importDefault(require("../rules/typescript/typescriptEslint"));
|
|
8
|
+
const typescriptImports_1 = __importDefault(require("../rules/typescript/typescriptImports"));
|
|
9
|
+
exports.default = [typescriptBase_1.default, typescriptEslint_1.default, typescriptImports_1.default];
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
name: string;
|
|
13
13
|
message: string;
|
|
14
14
|
}, ...{
|
|
15
|
-
name: "self" | "location" | "
|
|
15
|
+
name: "self" | "location" | "length" | "find" | "addEventListener" | "blur" | "close" | "closed" | "confirm" | "defaultStatus" | "defaultstatus" | "event" | "external" | "focus" | "frameElement" | "frames" | "history" | "innerHeight" | "innerWidth" | "locationbar" | "menubar" | "moveBy" | "moveTo" | "name" | "onblur" | "onerror" | "onfocus" | "onload" | "onresize" | "onunload" | "open" | "opener" | "opera" | "outerHeight" | "outerWidth" | "pageXOffset" | "pageYOffset" | "parent" | "print" | "removeEventListener" | "resizeBy" | "resizeTo" | "screen" | "screenLeft" | "screenTop" | "screenX" | "screenY" | "scroll" | "scrollbars" | "scrollBy" | "scrollTo" | "scrollX" | "scrollY" | "status" | "statusbar" | "stop" | "toolbar" | "top";
|
|
16
16
|
message: string;
|
|
17
17
|
}[]];
|
|
18
18
|
'no-shadow': "error";
|
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
typescript: Linter.Config<Linter.RulesRecord>
|
|
3
|
+
typescript: (Linter.Config<Linter.RulesRecord> | {
|
|
4
|
+
name: string;
|
|
5
|
+
rules: {
|
|
6
|
+
'constructor-super': "off";
|
|
7
|
+
'getter-return': "off";
|
|
8
|
+
'no-class-assign': "off";
|
|
9
|
+
'no-const-assign': "off";
|
|
10
|
+
'no-dupe-args': "off";
|
|
11
|
+
'no-dupe-keys': "off";
|
|
12
|
+
'no-func-assign': "off";
|
|
13
|
+
'no-import-assign': "off";
|
|
14
|
+
'no-new-native-nonconstructor': "off";
|
|
15
|
+
'no-obj-calls': "off";
|
|
16
|
+
'no-setter-return': "off";
|
|
17
|
+
'no-this-before-super': "off";
|
|
18
|
+
'no-undef': "off";
|
|
19
|
+
'no-unreachable': "off";
|
|
20
|
+
'no-unsafe-negation': "off";
|
|
21
|
+
'no-with': "off";
|
|
22
|
+
'valid-typeof': "off";
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
name: string;
|
|
26
|
+
settings: {
|
|
27
|
+
'import-x/parsers': {
|
|
28
|
+
'@typescript-eslint/parser': (string | string[])[];
|
|
29
|
+
};
|
|
30
|
+
'import-x/resolver': {
|
|
31
|
+
node: {
|
|
32
|
+
extensions: (string | string[])[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
'import-x/resolver-next': {
|
|
36
|
+
interfaceVersion: number;
|
|
37
|
+
name: string;
|
|
38
|
+
resolve(source: string, file: string): ResolvedResult;
|
|
39
|
+
}[];
|
|
40
|
+
'import-x/extensions': string[];
|
|
41
|
+
'import-x/external-module-folders': string[];
|
|
42
|
+
};
|
|
43
|
+
rules: {
|
|
44
|
+
'import-x/extensions': ["error", string, {
|
|
45
|
+
[k: string]: string;
|
|
46
|
+
}];
|
|
47
|
+
'import-x/no-extraneous-dependencies': ["error", {
|
|
48
|
+
devDependencies: string[];
|
|
49
|
+
optionalDependencies: boolean;
|
|
50
|
+
peerDependencies: boolean;
|
|
51
|
+
bundledDependencies: boolean;
|
|
52
|
+
}];
|
|
53
|
+
'import-x/named': "off";
|
|
54
|
+
'import-x/no-named-as-default-member': "off";
|
|
55
|
+
};
|
|
56
|
+
})[];
|
|
4
57
|
};
|
|
5
58
|
export default _default;
|
package/dist/typescript/index.js
CHANGED
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
6
|
+
const typescriptBase_1 = __importDefault(require("../rules/typescript/typescriptBase"));
|
|
7
|
+
const typescriptEslint_1 = __importDefault(require("../rules/typescript/typescriptEslint"));
|
|
8
|
+
const typescriptImports_1 = __importDefault(require("../rules/typescript/typescriptImports"));
|
|
7
9
|
exports.default = {
|
|
8
|
-
typescript:
|
|
10
|
+
typescript: [typescriptBase_1.default, typescriptEslint_1.default, typescriptImports_1.default],
|
|
9
11
|
};
|
|
@@ -1,6 +1,112 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
base: Linter.Config<Linter.RulesRecord>
|
|
4
|
-
|
|
3
|
+
base: (Linter.Config<Linter.RulesRecord> | {
|
|
4
|
+
name: string;
|
|
5
|
+
rules: {
|
|
6
|
+
'constructor-super': "off";
|
|
7
|
+
'getter-return': "off";
|
|
8
|
+
'no-class-assign': "off";
|
|
9
|
+
'no-const-assign': "off";
|
|
10
|
+
'no-dupe-args': "off";
|
|
11
|
+
'no-dupe-keys': "off";
|
|
12
|
+
'no-func-assign': "off";
|
|
13
|
+
'no-import-assign': "off";
|
|
14
|
+
'no-new-native-nonconstructor': "off";
|
|
15
|
+
'no-obj-calls': "off";
|
|
16
|
+
'no-setter-return': "off";
|
|
17
|
+
'no-this-before-super': "off";
|
|
18
|
+
'no-undef': "off";
|
|
19
|
+
'no-unreachable': "off";
|
|
20
|
+
'no-unsafe-negation': "off";
|
|
21
|
+
'no-with': "off";
|
|
22
|
+
'valid-typeof': "off";
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
name: string;
|
|
26
|
+
settings: {
|
|
27
|
+
'import-x/parsers': {
|
|
28
|
+
'@typescript-eslint/parser': (string | string[])[];
|
|
29
|
+
};
|
|
30
|
+
'import-x/resolver': {
|
|
31
|
+
node: {
|
|
32
|
+
extensions: (string | string[])[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
'import-x/resolver-next': {
|
|
36
|
+
interfaceVersion: number;
|
|
37
|
+
name: string;
|
|
38
|
+
resolve(source: string, file: string): ResolvedResult;
|
|
39
|
+
}[];
|
|
40
|
+
'import-x/extensions': string[];
|
|
41
|
+
'import-x/external-module-folders': string[];
|
|
42
|
+
};
|
|
43
|
+
rules: {
|
|
44
|
+
'import-x/extensions': ["error", string, {
|
|
45
|
+
[k: string]: string;
|
|
46
|
+
}];
|
|
47
|
+
'import-x/no-extraneous-dependencies': ["error", {
|
|
48
|
+
devDependencies: string[];
|
|
49
|
+
optionalDependencies: boolean;
|
|
50
|
+
peerDependencies: boolean;
|
|
51
|
+
bundledDependencies: boolean;
|
|
52
|
+
}];
|
|
53
|
+
'import-x/named': "off";
|
|
54
|
+
'import-x/no-named-as-default-member': "off";
|
|
55
|
+
};
|
|
56
|
+
})[];
|
|
57
|
+
react: (Linter.Config<Linter.RulesRecord> | {
|
|
58
|
+
name: string;
|
|
59
|
+
rules: {
|
|
60
|
+
'constructor-super': "off";
|
|
61
|
+
'getter-return': "off";
|
|
62
|
+
'no-class-assign': "off";
|
|
63
|
+
'no-const-assign': "off";
|
|
64
|
+
'no-dupe-args': "off";
|
|
65
|
+
'no-dupe-keys': "off";
|
|
66
|
+
'no-func-assign': "off";
|
|
67
|
+
'no-import-assign': "off";
|
|
68
|
+
'no-new-native-nonconstructor': "off";
|
|
69
|
+
'no-obj-calls': "off";
|
|
70
|
+
'no-setter-return': "off";
|
|
71
|
+
'no-this-before-super': "off";
|
|
72
|
+
'no-undef': "off";
|
|
73
|
+
'no-unreachable': "off";
|
|
74
|
+
'no-unsafe-negation': "off";
|
|
75
|
+
'no-with': "off";
|
|
76
|
+
'valid-typeof': "off";
|
|
77
|
+
};
|
|
78
|
+
} | {
|
|
79
|
+
name: string;
|
|
80
|
+
settings: {
|
|
81
|
+
'import-x/parsers': {
|
|
82
|
+
'@typescript-eslint/parser': (string | string[])[];
|
|
83
|
+
};
|
|
84
|
+
'import-x/resolver': {
|
|
85
|
+
node: {
|
|
86
|
+
extensions: (string | string[])[];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
'import-x/resolver-next': {
|
|
90
|
+
interfaceVersion: number;
|
|
91
|
+
name: string;
|
|
92
|
+
resolve(source: string, file: string): ResolvedResult;
|
|
93
|
+
}[];
|
|
94
|
+
'import-x/extensions': string[];
|
|
95
|
+
'import-x/external-module-folders': string[];
|
|
96
|
+
};
|
|
97
|
+
rules: {
|
|
98
|
+
'import-x/extensions': ["error", string, {
|
|
99
|
+
[k: string]: string;
|
|
100
|
+
}];
|
|
101
|
+
'import-x/no-extraneous-dependencies': ["error", {
|
|
102
|
+
devDependencies: string[];
|
|
103
|
+
optionalDependencies: boolean;
|
|
104
|
+
peerDependencies: boolean;
|
|
105
|
+
bundledDependencies: boolean;
|
|
106
|
+
}];
|
|
107
|
+
'import-x/named': "off";
|
|
108
|
+
'import-x/no-named-as-default-member': "off";
|
|
109
|
+
};
|
|
110
|
+
})[];
|
|
5
111
|
};
|
|
6
112
|
export default _default;
|
|
@@ -1,53 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const typescript_1 =
|
|
6
|
+
const typescript_1 = __importDefault(require("../typescript"));
|
|
7
|
+
const utils_1 = require("../utils");
|
|
37
8
|
exports.default = {
|
|
38
|
-
base: typescript_1.default,
|
|
9
|
+
base: typescript_1.default.typescript,
|
|
39
10
|
react: [
|
|
40
|
-
...typescript_1.default,
|
|
11
|
+
...typescript_1.default.typescript,
|
|
41
12
|
{
|
|
42
13
|
name: 'airbnb/config/typescript-react',
|
|
43
|
-
settings: {
|
|
44
|
-
// Append 'tsx' extensions to Airbnb 'import/resolver' setting
|
|
45
|
-
'import/resolver': {
|
|
46
|
-
node: {
|
|
47
|
-
extensions: [...typescript_1.importResolverExtensions, '.tsx'],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
14
|
rules: {
|
|
52
15
|
// Append 'tsx' to Airbnb 'react/jsx-filename-extension' rule
|
|
53
16
|
'react/jsx-filename-extension': [
|
|
@@ -58,5 +21,15 @@ exports.default = {
|
|
|
58
21
|
],
|
|
59
22
|
},
|
|
60
23
|
},
|
|
24
|
+
{
|
|
25
|
+
name: 'airbnb/config/typescript-import-x',
|
|
26
|
+
settings: {
|
|
27
|
+
'import-x/resolver': {
|
|
28
|
+
node: {
|
|
29
|
+
extensions: [...utils_1.jsExtensionsResolver, ...utils_1.tsExtensionsWithReactDTS],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
61
34
|
],
|
|
62
35
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const jsExtensions: string[];
|
|
2
|
+
export declare const jsExtensionsWithReact: string[];
|
|
3
|
+
export declare const jsExtensionsResolver: string[];
|
|
4
|
+
export declare const jsExtensionsRule: {
|
|
5
|
+
[k: string]: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const tsExtensions: string[];
|
|
8
|
+
export declare const tsExtensionsWithReact: string[];
|
|
9
|
+
export declare const tsExtensionsWithReactDTS: string[];
|
|
10
|
+
export declare const tsExtensionsResolver: (string | string[])[];
|
|
11
|
+
export declare const tsExtensionsRule: {
|
|
12
|
+
[k: string]: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tsExtensionsRule = exports.tsExtensionsResolver = exports.tsExtensionsWithReactDTS = exports.tsExtensionsWithReact = exports.tsExtensions = exports.jsExtensionsRule = exports.jsExtensionsResolver = exports.jsExtensionsWithReact = exports.jsExtensions = void 0;
|
|
4
|
+
exports.jsExtensions = ['.js', '.cjs', '.mjs'];
|
|
5
|
+
exports.jsExtensionsWithReact = [...exports.jsExtensions, '.jsx'];
|
|
6
|
+
exports.jsExtensionsResolver = [...exports.jsExtensions, '.json'];
|
|
7
|
+
exports.jsExtensionsRule = Object.fromEntries(Object.values(exports.jsExtensionsWithReact).map((val) => [val.slice(1), 'never']));
|
|
8
|
+
exports.tsExtensions = ['.ts', '.cts', '.mts'];
|
|
9
|
+
exports.tsExtensionsWithReact = [...exports.tsExtensions, '.tsx'];
|
|
10
|
+
exports.tsExtensionsWithReactDTS = [...exports.tsExtensionsWithReact, '.d.ts'];
|
|
11
|
+
exports.tsExtensionsResolver = [exports.tsExtensions, '.d.ts'];
|
|
12
|
+
exports.tsExtensionsRule = Object.fromEntries(Object.values(exports.tsExtensionsWithReact).map((val) => [val.slice(1), 'never']));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-airbnb-extended",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Eslint Airbnb Config Extended",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/confusing-browser-globals": "^1.0.3",
|
|
39
39
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
40
40
|
"eslint": "^9.24.0",
|
|
41
|
-
"eslint-plugin-import": "^
|
|
41
|
+
"eslint-plugin-import-x": "^4.10.1",
|
|
42
42
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
43
43
|
"eslint-plugin-react": "^7.37.5",
|
|
44
44
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -47,14 +47,22 @@
|
|
|
47
47
|
"typescript-eslint": "^8.29.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
+
"@next/eslint-plugin-next": "^15.2.4",
|
|
50
51
|
"eslint": "9.x",
|
|
51
|
-
"eslint-
|
|
52
|
+
"eslint-import-resolver-typescript": "^4.3.1",
|
|
53
|
+
"eslint-plugin-import-x": "4.x",
|
|
52
54
|
"eslint-plugin-jsx-a11y": "6.x",
|
|
53
55
|
"eslint-plugin-react": "7.x",
|
|
54
56
|
"eslint-plugin-react-hooks": "5.x",
|
|
55
57
|
"typescript-eslint": "8.x"
|
|
56
58
|
},
|
|
57
59
|
"peerDependenciesMeta": {
|
|
60
|
+
"@next/eslint-plugin-next": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"eslint-import-resolver-typescript": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
58
66
|
"eslint-plugin-jsx-a11y": {
|
|
59
67
|
"optional": true
|
|
60
68
|
},
|