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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
rules: {
|
|
4
|
+
'import-x/group-exports': "error";
|
|
5
|
+
'import-x/no-anonymous-default-export': ["error", {
|
|
6
|
+
allowArray: boolean;
|
|
7
|
+
allowObject: boolean;
|
|
8
|
+
}];
|
|
9
|
+
'import-x/no-namespace': "error";
|
|
10
|
+
'import-x/no-unused-modules': ["warn", {
|
|
11
|
+
missingExports: boolean;
|
|
12
|
+
unusedExports: boolean;
|
|
13
|
+
}];
|
|
14
|
+
'import-x/order': ["error", {
|
|
15
|
+
groups: (string | string[])[];
|
|
16
|
+
pathGroups: {
|
|
17
|
+
pattern: string;
|
|
18
|
+
group: string;
|
|
19
|
+
position: string;
|
|
20
|
+
}[];
|
|
21
|
+
pathGroupsExcludedImportTypes: string[];
|
|
22
|
+
distinctGroup: boolean;
|
|
23
|
+
'newlines-between': string;
|
|
24
|
+
alphabetize: {
|
|
25
|
+
order: string;
|
|
26
|
+
orderImportKind: string;
|
|
27
|
+
caseInsensitive: boolean;
|
|
28
|
+
};
|
|
29
|
+
named: {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
import: boolean;
|
|
32
|
+
export: boolean;
|
|
33
|
+
require: boolean;
|
|
34
|
+
cjsExports: boolean;
|
|
35
|
+
types: string;
|
|
36
|
+
};
|
|
37
|
+
warnOnUnassignedImports: boolean;
|
|
38
|
+
sortTypesGroup: boolean;
|
|
39
|
+
'newlines-between-types': string;
|
|
40
|
+
}];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
name: 'airbnb/config/imports-strict',
|
|
5
|
+
rules: {
|
|
6
|
+
// Reports when named exports are not grouped together in a single export declaration
|
|
7
|
+
// or when multiple assignments to CommonJS module.exports or exports object are present
|
|
8
|
+
// in a single file.
|
|
9
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md
|
|
10
|
+
'import-x/group-exports': 'error',
|
|
11
|
+
// Reports if a module's default export is unnamed
|
|
12
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
|
|
13
|
+
'import-x/no-anonymous-default-export': [
|
|
14
|
+
'error',
|
|
15
|
+
{
|
|
16
|
+
allowArray: true,
|
|
17
|
+
allowObject: true,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
// disallow namespace imports
|
|
21
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-namespace.md
|
|
22
|
+
'import-x/no-namespace': 'error',
|
|
23
|
+
// Reports modules without any exports, or with unused exports
|
|
24
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unused-modules.md
|
|
25
|
+
'import-x/no-unused-modules': [
|
|
26
|
+
'warn',
|
|
27
|
+
{
|
|
28
|
+
missingExports: true,
|
|
29
|
+
unusedExports: true,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
// ensure absolute imports are above relative imports and that unassigned imports are ignored
|
|
33
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/order.md
|
|
34
|
+
'import-x/order': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
groups: [
|
|
38
|
+
'builtin',
|
|
39
|
+
'external',
|
|
40
|
+
'internal',
|
|
41
|
+
['parent', 'sibling', 'index'],
|
|
42
|
+
'object',
|
|
43
|
+
['unknown', 'type'],
|
|
44
|
+
],
|
|
45
|
+
pathGroups: [
|
|
46
|
+
{
|
|
47
|
+
pattern: 'react',
|
|
48
|
+
group: 'external',
|
|
49
|
+
position: 'before',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
pathGroupsExcludedImportTypes: ['type'],
|
|
53
|
+
distinctGroup: true,
|
|
54
|
+
'newlines-between': 'always',
|
|
55
|
+
alphabetize: {
|
|
56
|
+
order: 'asc',
|
|
57
|
+
orderImportKind: 'asc',
|
|
58
|
+
caseInsensitive: true,
|
|
59
|
+
},
|
|
60
|
+
named: {
|
|
61
|
+
enabled: true,
|
|
62
|
+
import: true,
|
|
63
|
+
export: true,
|
|
64
|
+
require: true,
|
|
65
|
+
cjsExports: true,
|
|
66
|
+
types: 'types-last',
|
|
67
|
+
},
|
|
68
|
+
warnOnUnassignedImports: true,
|
|
69
|
+
sortTypesGroup: true,
|
|
70
|
+
'newlines-between-types': 'always',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// @ts-expect-error eslint-plugin-import not working in import
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports,unicorn/prefer-module
|
|
5
|
+
const ESLintPluginNext = require('@next/eslint-plugin-next');
|
|
6
|
+
exports.default = {
|
|
7
|
+
name: 'airbnb/config/next',
|
|
8
|
+
plugins: {
|
|
9
|
+
'@next/next': ESLintPluginNext,
|
|
10
|
+
},
|
|
11
|
+
rules: Object.assign(Object.assign({}, ESLintPluginNext.configs.recommended.rules), ESLintPluginNext.configs['core-web-vitals'].rules),
|
|
12
|
+
};
|
package/dist/rules/react.d.ts
CHANGED
package/dist/rules/react.js
CHANGED
|
@@ -21,11 +21,6 @@ exports.default = {
|
|
|
21
21
|
globals: Object.assign({}, globals_1.default.browser),
|
|
22
22
|
},
|
|
23
23
|
settings: {
|
|
24
|
-
'import/resolver': {
|
|
25
|
-
node: {
|
|
26
|
-
extensions: ['.js', '.cjs', '.mjs', '.jsx', '.json'],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
24
|
react: {
|
|
30
25
|
pragma: 'React',
|
|
31
26
|
version: 'detect',
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
rules: {
|
|
4
|
+
'constructor-super': "off";
|
|
5
|
+
'getter-return': "off";
|
|
6
|
+
'no-class-assign': "off";
|
|
7
|
+
'no-const-assign': "off";
|
|
8
|
+
'no-dupe-args': "off";
|
|
9
|
+
'no-dupe-keys': "off";
|
|
10
|
+
'no-func-assign': "off";
|
|
11
|
+
'no-import-assign': "off";
|
|
12
|
+
'no-new-native-nonconstructor': "off";
|
|
13
|
+
'no-obj-calls': "off";
|
|
14
|
+
'no-setter-return': "off";
|
|
15
|
+
'no-this-before-super': "off";
|
|
16
|
+
'no-undef': "off";
|
|
17
|
+
'no-unreachable': "off";
|
|
18
|
+
'no-unsafe-negation': "off";
|
|
19
|
+
'no-with': "off";
|
|
20
|
+
'valid-typeof': "off";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
name: 'airbnb/config/typescript',
|
|
5
|
+
rules: {
|
|
6
|
+
// The following rules are enabled in Airbnb config, but are already checked (more thoroughly) by the TypeScript compiler
|
|
7
|
+
// Rules are inspired by: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts
|
|
8
|
+
'constructor-super': 'off', // ts(2335) & ts(2377)
|
|
9
|
+
'getter-return': 'off', // ts(2378)
|
|
10
|
+
'no-class-assign': 'off', // ts(2629)
|
|
11
|
+
'no-const-assign': 'off', // ts(2588)
|
|
12
|
+
'no-dupe-args': 'off', // ts(2300)
|
|
13
|
+
'no-dupe-keys': 'off', // ts(1117)
|
|
14
|
+
'no-func-assign': 'off', // ts(2630)
|
|
15
|
+
'no-import-assign': 'off', // ts(2632) & ts(2540)
|
|
16
|
+
'no-new-native-nonconstructor': 'off', // ts(7009)
|
|
17
|
+
'no-obj-calls': 'off', // ts(2349)
|
|
18
|
+
'no-setter-return': 'off', // ts(2408)
|
|
19
|
+
'no-this-before-super': 'off', // ts(2376) & ts(17009)
|
|
20
|
+
'no-undef': 'off', // ts(2304) & ts(2552)
|
|
21
|
+
'no-unreachable': 'off', // ts(7027)
|
|
22
|
+
'no-unsafe-negation': 'off', // ts(2365) & ts(2322) & ts(2358)
|
|
23
|
+
'no-with': 'off', // ts(1101) & ts(2410)
|
|
24
|
+
'valid-typeof': 'off',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
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("../../rules/best-practices"));
|
|
8
|
+
const errors_1 = __importDefault(require("../../rules/errors"));
|
|
9
|
+
const es6_1 = __importDefault(require("../../rules/es6"));
|
|
10
|
+
const style_1 = __importDefault(require("../../rules/style"));
|
|
11
|
+
const variables_1 = __importDefault(require("../../rules/variables"));
|
|
12
|
+
exports.default = {
|
|
13
|
+
name: 'airbnb/config/typescript/eslint',
|
|
14
|
+
plugins: {
|
|
15
|
+
'@typescript-eslint': typescript_eslint_1.plugin,
|
|
16
|
+
},
|
|
17
|
+
languageOptions: {
|
|
18
|
+
parser: typescript_eslint_1.parser,
|
|
19
|
+
parserOptions: {
|
|
20
|
+
projectService: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
// Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
|
|
25
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
|
|
26
|
+
'brace-style': 'off',
|
|
27
|
+
'@typescript-eslint/brace-style': style_1.default.rules['brace-style'],
|
|
28
|
+
// Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
|
|
29
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
30
|
+
camelcase: 'off',
|
|
31
|
+
// The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings. However, the existing `no-underscore-dangle` rule already takes care of this.
|
|
32
|
+
'@typescript-eslint/naming-convention': [
|
|
33
|
+
'error',
|
|
34
|
+
// Allow camelCase variables (23.2), PascalCase variables (23.8), and UPPER_CASE variables (23.10)
|
|
35
|
+
{
|
|
36
|
+
selector: 'variable',
|
|
37
|
+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
38
|
+
},
|
|
39
|
+
// Allow camelCase functions (23.2), and PascalCase functions (23.8)
|
|
40
|
+
{
|
|
41
|
+
selector: 'function',
|
|
42
|
+
format: ['camelCase', 'PascalCase'],
|
|
43
|
+
},
|
|
44
|
+
// 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
|
|
45
|
+
{
|
|
46
|
+
selector: 'typeLike',
|
|
47
|
+
format: ['PascalCase'],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
// Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
|
|
51
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
|
|
52
|
+
// The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
|
|
53
|
+
'comma-dangle': 'off',
|
|
54
|
+
'@typescript-eslint/comma-dangle': [
|
|
55
|
+
style_1.default.rules['comma-dangle'][0],
|
|
56
|
+
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 }),
|
|
57
|
+
],
|
|
58
|
+
// Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
|
|
59
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
|
|
60
|
+
'comma-spacing': 'off',
|
|
61
|
+
'@typescript-eslint/comma-spacing': style_1.default.rules['comma-spacing'],
|
|
62
|
+
// Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
|
|
63
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
|
|
64
|
+
'default-param-last': 'off',
|
|
65
|
+
'@typescript-eslint/default-param-last': best_practices_1.default.rules['default-param-last'],
|
|
66
|
+
// Replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
|
|
67
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
|
|
68
|
+
'dot-notation': 'off',
|
|
69
|
+
'@typescript-eslint/dot-notation': best_practices_1.default.rules['dot-notation'],
|
|
70
|
+
// Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
|
|
71
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
|
|
72
|
+
'func-call-spacing': 'off',
|
|
73
|
+
'@typescript-eslint/func-call-spacing': style_1.default.rules['func-call-spacing'],
|
|
74
|
+
// Replace Airbnb 'indent' rule with '@typescript-eslint' version
|
|
75
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
|
|
76
|
+
indent: 'off',
|
|
77
|
+
'@typescript-eslint/indent': style_1.default.rules.indent,
|
|
78
|
+
// Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
|
|
79
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
|
|
80
|
+
'keyword-spacing': 'off',
|
|
81
|
+
'@typescript-eslint/keyword-spacing': style_1.default.rules['keyword-spacing'],
|
|
82
|
+
// Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
|
|
83
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
|
|
84
|
+
'lines-between-class-members': 'off',
|
|
85
|
+
'@typescript-eslint/lines-between-class-members': style_1.default.rules['lines-between-class-members'],
|
|
86
|
+
// Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
|
|
87
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
|
|
88
|
+
'no-array-constructor': 'off',
|
|
89
|
+
'@typescript-eslint/no-array-constructor': style_1.default.rules['no-array-constructor'],
|
|
90
|
+
// Replace Airbnb 'no-dupe-class-members' rule with '@typescript-eslint' version
|
|
91
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
|
|
92
|
+
'no-dupe-class-members': 'off',
|
|
93
|
+
'@typescript-eslint/no-dupe-class-members': es6_1.default.rules['no-dupe-class-members'],
|
|
94
|
+
// Replace Airbnb 'no-empty-function' rule with '@typescript-eslint' version
|
|
95
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
|
|
96
|
+
'no-empty-function': 'off',
|
|
97
|
+
'@typescript-eslint/no-empty-function': best_practices_1.default.rules['no-empty-function'],
|
|
98
|
+
// Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
|
|
99
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
|
|
100
|
+
'no-extra-parens': 'off',
|
|
101
|
+
'@typescript-eslint/no-extra-parens': errors_1.default.rules['no-extra-parens'],
|
|
102
|
+
// Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
|
|
103
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
|
|
104
|
+
'no-extra-semi': 'off',
|
|
105
|
+
'@typescript-eslint/no-extra-semi': errors_1.default.rules['no-extra-semi'],
|
|
106
|
+
// Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
|
|
107
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
|
|
108
|
+
'no-implied-eval': 'off',
|
|
109
|
+
'no-new-func': 'off',
|
|
110
|
+
'@typescript-eslint/no-implied-eval': best_practices_1.default.rules['no-implied-eval'],
|
|
111
|
+
// Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version
|
|
112
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
|
|
113
|
+
'no-loss-of-precision': 'off',
|
|
114
|
+
'@typescript-eslint/no-loss-of-precision': errors_1.default.rules['no-loss-of-precision'],
|
|
115
|
+
// Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
|
|
116
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
|
|
117
|
+
'no-loop-func': 'off',
|
|
118
|
+
'@typescript-eslint/no-loop-func': best_practices_1.default.rules['no-loop-func'],
|
|
119
|
+
// Replace Airbnb 'no-magic-numbers' rule with '@typescript-eslint' version
|
|
120
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
|
|
121
|
+
'no-magic-numbers': 'off',
|
|
122
|
+
'@typescript-eslint/no-magic-numbers': best_practices_1.default.rules['no-magic-numbers'],
|
|
123
|
+
// Replace Airbnb 'no-redeclare' rule with '@typescript-eslint' version
|
|
124
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
|
|
125
|
+
'no-redeclare': 'off',
|
|
126
|
+
'@typescript-eslint/no-redeclare': best_practices_1.default.rules['no-redeclare'],
|
|
127
|
+
// Replace Airbnb 'no-shadow' rule with '@typescript-eslint' version
|
|
128
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
|
|
129
|
+
'no-shadow': 'off',
|
|
130
|
+
'@typescript-eslint/no-shadow': variables_1.default.rules['no-shadow'],
|
|
131
|
+
// Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version
|
|
132
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md
|
|
133
|
+
'space-before-blocks': 'off',
|
|
134
|
+
'@typescript-eslint/space-before-blocks': style_1.default.rules['space-before-blocks'],
|
|
135
|
+
// Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
|
|
136
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
|
|
137
|
+
'no-throw-literal': 'off',
|
|
138
|
+
'@typescript-eslint/no-throw-literal': best_practices_1.default.rules['no-throw-literal'],
|
|
139
|
+
// Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
|
|
140
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
141
|
+
'no-unused-expressions': 'off',
|
|
142
|
+
'@typescript-eslint/no-unused-expressions': best_practices_1.default.rules['no-unused-expressions'],
|
|
143
|
+
// Replace Airbnb 'no-unused-vars' rule with '@typescript-eslint' version
|
|
144
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
|
|
145
|
+
'no-unused-vars': 'off',
|
|
146
|
+
'@typescript-eslint/no-unused-vars': variables_1.default.rules['no-unused-vars'],
|
|
147
|
+
// Replace Airbnb 'no-use-before-define' rule with '@typescript-eslint' version
|
|
148
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
|
|
149
|
+
'no-use-before-define': 'off',
|
|
150
|
+
'@typescript-eslint/no-use-before-define': variables_1.default.rules['no-use-before-define'],
|
|
151
|
+
// Replace Airbnb 'no-useless-constructor' rule with '@typescript-eslint' version
|
|
152
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
|
|
153
|
+
'no-useless-constructor': 'off',
|
|
154
|
+
'@typescript-eslint/no-useless-constructor': es6_1.default.rules['no-useless-constructor'],
|
|
155
|
+
// Replace Airbnb 'quotes' rule with '@typescript-eslint' version
|
|
156
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
|
|
157
|
+
quotes: 'off',
|
|
158
|
+
'@typescript-eslint/quotes': style_1.default.rules.quotes,
|
|
159
|
+
// Replace Airbnb 'semi' rule with '@typescript-eslint' version
|
|
160
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
|
|
161
|
+
semi: 'off',
|
|
162
|
+
'@typescript-eslint/semi': style_1.default.rules.semi,
|
|
163
|
+
// Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
|
|
164
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
|
|
165
|
+
'space-before-function-paren': 'off',
|
|
166
|
+
'@typescript-eslint/space-before-function-paren': style_1.default.rules['space-before-function-paren'],
|
|
167
|
+
// Replace Airbnb 'require-await' rule with '@typescript-eslint' version
|
|
168
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
169
|
+
'require-await': 'off',
|
|
170
|
+
'@typescript-eslint/require-await': best_practices_1.default.rules['require-await'],
|
|
171
|
+
// Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
|
|
172
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
173
|
+
'no-return-await': 'off',
|
|
174
|
+
'@typescript-eslint/return-await': [best_practices_1.default.rules['no-return-await'], 'in-try-catch'],
|
|
175
|
+
// Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
|
|
176
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
|
|
177
|
+
'space-infix-ops': 'off',
|
|
178
|
+
'@typescript-eslint/space-infix-ops': style_1.default.rules['space-infix-ops'],
|
|
179
|
+
// Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version
|
|
180
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md
|
|
181
|
+
'object-curly-spacing': 'off',
|
|
182
|
+
'@typescript-eslint/object-curly-spacing': style_1.default.rules['object-curly-spacing'],
|
|
183
|
+
},
|
|
184
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/src/config/typescript.ts
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
name: string;
|
|
6
|
+
settings: {
|
|
7
|
+
'import-x/parsers': {
|
|
8
|
+
'@typescript-eslint/parser': (string | string[])[];
|
|
9
|
+
};
|
|
10
|
+
'import-x/resolver': {
|
|
11
|
+
node: {
|
|
12
|
+
extensions: (string | string[])[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
'import-x/resolver-next': {
|
|
16
|
+
interfaceVersion: number;
|
|
17
|
+
name: string;
|
|
18
|
+
resolve(source: string, file: string): ResolvedResult;
|
|
19
|
+
}[];
|
|
20
|
+
'import-x/extensions': string[];
|
|
21
|
+
'import-x/external-module-folders': string[];
|
|
22
|
+
};
|
|
23
|
+
rules: {
|
|
24
|
+
'import-x/extensions': ["error", string, {
|
|
25
|
+
[k: string]: string;
|
|
26
|
+
}];
|
|
27
|
+
'import-x/no-extraneous-dependencies': ["error", {
|
|
28
|
+
devDependencies: string[];
|
|
29
|
+
optionalDependencies: boolean;
|
|
30
|
+
peerDependencies: boolean;
|
|
31
|
+
bundledDependencies: boolean;
|
|
32
|
+
}];
|
|
33
|
+
'import-x/named': "off";
|
|
34
|
+
'import-x/no-named-as-default-member': "off";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
4
|
+
const getDevDepsList_1 = require("../../helpers/getDevDepsList");
|
|
5
|
+
const eslint_import_resolver_typescript_1 = require("eslint-import-resolver-typescript");
|
|
6
|
+
/**
|
|
7
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/src/config/typescript.ts
|
|
8
|
+
*/
|
|
9
|
+
exports.default = {
|
|
10
|
+
name: 'airbnb/config/typescript/import-x',
|
|
11
|
+
settings: {
|
|
12
|
+
// Apply special parsing for TypeScript files
|
|
13
|
+
'import-x/parsers': {
|
|
14
|
+
'@typescript-eslint/parser': utils_1.tsExtensionsResolver,
|
|
15
|
+
},
|
|
16
|
+
// Append 'ts' extensions to Airbnb 'import-x/resolver' setting
|
|
17
|
+
'import-x/resolver': {
|
|
18
|
+
node: {
|
|
19
|
+
extensions: [...utils_1.jsExtensionsResolver, ...utils_1.tsExtensionsResolver],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
// Import Resolver for import-x package
|
|
23
|
+
'import-x/resolver-next': [
|
|
24
|
+
(0, eslint_import_resolver_typescript_1.createTypeScriptImportResolver)({
|
|
25
|
+
alwaysTryTypes: true,
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
// Append 'ts' extensions to Airbnb 'import-x/extensions' setting
|
|
29
|
+
'import-x/extensions': [...utils_1.jsExtensionsWithReact, ...utils_1.tsExtensionsWithReactDTS],
|
|
30
|
+
// Resolve type definition packages
|
|
31
|
+
'import-x/external-module-folders': ['node_modules', 'node_modules/@types'],
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
// Append 'ts' and 'tsx' to Airbnb 'import-x/extensions' rule
|
|
35
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md
|
|
36
|
+
'import-x/extensions': ['error', 'ignorePackages', utils_1.tsExtensionsRule],
|
|
37
|
+
// Append 'ts' and 'tsx' extensions to Airbnb 'import-x/no-extraneous-dependencies' rule
|
|
38
|
+
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
|
|
39
|
+
'import-x/no-extraneous-dependencies': [
|
|
40
|
+
'error',
|
|
41
|
+
{
|
|
42
|
+
devDependencies: (0, getDevDepsList_1.getDevDepsList)(utils_1.tsExtensions.join(',')),
|
|
43
|
+
optionalDependencies: false,
|
|
44
|
+
peerDependencies: true,
|
|
45
|
+
bundledDependencies: true,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
// See: https://github.com/typescript-eslint/typescript-eslint/blob/13583e65f5973da2a7ae8384493c5e00014db51b/docs/linting/TROUBLESHOOTING.md#eslint-plugin-import
|
|
49
|
+
// TypeScript compilation already ensures that named imports exist in the referenced module
|
|
50
|
+
'import-x/named': 'off',
|
|
51
|
+
// warn on accessing default export property names that are also named exports
|
|
52
|
+
'import-x/no-named-as-default-member': 'off',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
@@ -1,4 +1,47 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare const _default: (Linter.Config<Linter.RulesRecord> | {
|
|
3
|
+
name: string;
|
|
4
|
+
files: 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/resolver': {
|
|
28
|
+
node: {
|
|
29
|
+
extensions: (string | string[])[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
'import-x/extensions': string[];
|
|
33
|
+
'import-x/external-module-folders': string[];
|
|
34
|
+
};
|
|
35
|
+
rules: {
|
|
36
|
+
'import-x/extensions': ["error", string, {
|
|
37
|
+
[k: string]: string;
|
|
38
|
+
}];
|
|
39
|
+
'import-x/no-extraneous-dependencies': ["error", {
|
|
40
|
+
devDependencies: string[];
|
|
41
|
+
optionalDependencies: boolean;
|
|
42
|
+
peerDependencies: boolean;
|
|
43
|
+
bundledDependencies: boolean;
|
|
44
|
+
}];
|
|
45
|
+
};
|
|
46
|
+
})[];
|
|
4
47
|
export default _default;
|