eslint-config-airbnb-extended 0.1.0 → 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 +990 -0
- package/dist/base/index.js +23 -0
- package/dist/base/recommended.d.ts +990 -0
- package/dist/base/recommended.js +19 -0
- package/dist/helpers/getDevDepsList.d.ts +3 -0
- package/dist/helpers/getDevDepsList.js +31 -0
- package/dist/index.d.ts +15897 -0
- package/dist/index.js +37 -0
- package/dist/react/index.d.ts +1793 -0
- package/dist/react/index.js +13 -0
- package/dist/react/recommended.d.ts +2786 -0
- package/dist/react/recommended.js +22 -0
- package/dist/rules/best-practices.d.ts +177 -0
- package/dist/rules/best-practices.js +379 -0
- package/dist/rules/errors.d.ts +69 -0
- package/dist/rules/errors.js +151 -0
- package/dist/rules/es6.d.ts +146 -0
- package/dist/rules/es6.js +192 -0
- package/dist/rules/imports.d.ts +151 -0
- package/dist/rules/imports.js +203 -0
- 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/node.d.ts +90 -0
- package/dist/rules/node.js +39 -0
- package/dist/rules/react-a11y.d.ts +117 -0
- package/dist/rules/react-a11y.js +255 -0
- package/dist/rules/react-hooks.d.ts +19 -0
- package/dist/rules/react-hooks.js +57 -0
- package/dist/rules/react.d.ts +1659 -0
- package/dist/rules/react.js +578 -0
- package/dist/rules/strict.d.ts +7 -0
- package/dist/rules/strict.js +9 -0
- package/dist/rules/style.d.ts +320 -0
- package/dist/rules/style.js +530 -0
- 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 +47 -0
- package/dist/rules/typescript.js +9 -0
- package/dist/rules/variables.d.ts +35 -0
- package/dist/rules/variables.js +65 -0
- package/dist/typescript/index.d.ts +58 -0
- package/dist/typescript/index.js +11 -0
- package/dist/typescript/recommended.d.ts +112 -0
- package/dist/typescript/recommended.js +35 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +12 -0
- package/package.json +16 -9
- package/CHANGELOG.md +0 -7
- package/base/index.ts +0 -21
- package/base/recommended.ts +0 -17
- package/index.ts +0 -25
- package/react/index.ts +0 -11
- package/react/recommended.ts +0 -6
- package/rules/best-practices.ts +0 -462
- package/rules/errors.ts +0 -199
- package/rules/es6.ts +0 -224
- package/rules/imports.ts +0 -308
- package/rules/node.ts +0 -49
- package/rules/react-a11y.ts +0 -295
- package/rules/react-hooks.ts +0 -26
- package/rules/react.ts +0 -692
- package/rules/strict.ts +0 -9
- package/rules/style.ts +0 -632
- package/rules/typescript.ts +0 -312
- package/rules/variables.ts +0 -76
- package/tsconfig.json +0 -22
- package/typescript/index.ts +0 -7
- package/typescript/recommended.ts +0 -30
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
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
|
+
})[];
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 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];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
rules: {
|
|
4
|
+
'init-declarations': "off";
|
|
5
|
+
'no-catch-shadow': "off";
|
|
6
|
+
'no-delete-var': "error";
|
|
7
|
+
'no-label-var': "error";
|
|
8
|
+
'no-restricted-globals': ["error", {
|
|
9
|
+
name: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}, {
|
|
12
|
+
name: string;
|
|
13
|
+
message: string;
|
|
14
|
+
}, ...{
|
|
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
|
+
message: string;
|
|
17
|
+
}[]];
|
|
18
|
+
'no-shadow': "error";
|
|
19
|
+
'no-shadow-restricted-names': "error";
|
|
20
|
+
'no-undef': "error";
|
|
21
|
+
'no-undef-init': "error";
|
|
22
|
+
'no-undefined': "off";
|
|
23
|
+
'no-unused-vars': ["error", {
|
|
24
|
+
vars: string;
|
|
25
|
+
args: string;
|
|
26
|
+
ignoreRestSiblings: boolean;
|
|
27
|
+
}];
|
|
28
|
+
'no-use-before-define': ["error", {
|
|
29
|
+
functions: boolean;
|
|
30
|
+
classes: boolean;
|
|
31
|
+
variables: boolean;
|
|
32
|
+
}];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
exports.default = {
|
|
8
|
+
name: 'airbnb/config/variables',
|
|
9
|
+
rules: {
|
|
10
|
+
// enforce or disallow variable initializations at definition
|
|
11
|
+
'init-declarations': 'off',
|
|
12
|
+
// disallow the catch clause parameter name being the same as a variable in the outer scope
|
|
13
|
+
'no-catch-shadow': 'off',
|
|
14
|
+
// disallow deletion of variables
|
|
15
|
+
'no-delete-var': 'error',
|
|
16
|
+
// disallow labels that share a name with a variable
|
|
17
|
+
// https://eslint.org/docs/rules/no-label-var
|
|
18
|
+
'no-label-var': 'error',
|
|
19
|
+
// disallow specific globals
|
|
20
|
+
'no-restricted-globals': [
|
|
21
|
+
'error',
|
|
22
|
+
{
|
|
23
|
+
name: 'isFinite',
|
|
24
|
+
message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'isNaN',
|
|
28
|
+
message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
|
|
29
|
+
},
|
|
30
|
+
...confusing_browser_globals_1.default.map((g) => ({
|
|
31
|
+
name: g,
|
|
32
|
+
message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
|
|
33
|
+
})),
|
|
34
|
+
],
|
|
35
|
+
// disallow declaration of variables already declared in the outer scope
|
|
36
|
+
'no-shadow': 'error',
|
|
37
|
+
// disallow shadowing of names such as arguments
|
|
38
|
+
'no-shadow-restricted-names': 'error',
|
|
39
|
+
// disallow use of undeclared variables unless mentioned in a /*global */ block
|
|
40
|
+
'no-undef': 'error',
|
|
41
|
+
// disallow use of undefined when initializing variables
|
|
42
|
+
'no-undef-init': 'error',
|
|
43
|
+
// disallow use of undefined variable
|
|
44
|
+
// https://eslint.org/docs/rules/no-undefined
|
|
45
|
+
'no-undefined': 'off',
|
|
46
|
+
// disallow declaration of variables that are not used in the code
|
|
47
|
+
'no-unused-vars': [
|
|
48
|
+
'error',
|
|
49
|
+
{
|
|
50
|
+
vars: 'all',
|
|
51
|
+
args: 'after-used',
|
|
52
|
+
ignoreRestSiblings: true,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
// disallow use of variables before they are defined
|
|
56
|
+
'no-use-before-define': [
|
|
57
|
+
'error',
|
|
58
|
+
{
|
|
59
|
+
functions: true,
|
|
60
|
+
classes: true,
|
|
61
|
+
variables: true,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const _default: {
|
|
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
|
+
})[];
|
|
57
|
+
};
|
|
58
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 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 = {
|
|
10
|
+
typescript: [typescriptBase_1.default, typescriptEslint_1.default, typescriptImports_1.default],
|
|
11
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
declare const _default: {
|
|
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
|
+
})[];
|
|
111
|
+
};
|
|
112
|
+
export default _default;
|