eslint-config-airbnb-extended 0.4.0 → 0.5.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/@types/index.d.ts +1 -1
- package/dist/configs/base/index.js +2 -0
- package/dist/configs/base/recommended.js +0 -1
- package/dist/configs/index.js +1 -1
- package/dist/configs/typescript/recommended.js +2 -2
- package/dist/plugins/reactHooksPlugin.js +0 -7
- package/dist/plugins/typescriptEslintPlugin.js +0 -3
- package/dist/rules/best-practices.js +63 -41
- package/dist/rules/errors.js +22 -31
- package/dist/rules/es6.js +0 -32
- package/dist/rules/imports.js +1 -1
- package/dist/rules/index.js +2 -1
- package/dist/rules/react-a11y.js +79 -73
- package/dist/rules/react-hooks.js +4 -4
- package/dist/rules/react.js +372 -335
- package/dist/rules/reactStrict.js +86 -0
- package/dist/rules/style.js +36 -364
- package/dist/rules/stylistic.js +526 -0
- package/dist/rules/typescript/typescriptEslint.js +25 -31
- package/dist/rules/variables.js +0 -2
- package/package.json +1 -1
|
@@ -4,17 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const best_practices_1 = __importDefault(require("../../rules/best-practices"));
|
|
7
|
-
const errors_1 = __importDefault(require("../../rules/errors"));
|
|
8
7
|
const es6_1 = __importDefault(require("../../rules/es6"));
|
|
9
8
|
const style_1 = __importDefault(require("../../rules/style"));
|
|
9
|
+
const stylistic_1 = __importDefault(require("../../rules/stylistic"));
|
|
10
10
|
const variables_1 = __importDefault(require("../../rules/variables"));
|
|
11
11
|
const typescriptEslintRules = {
|
|
12
12
|
name: 'airbnb/config/typescript/typescript-eslint',
|
|
13
|
+
languageOptions: {
|
|
14
|
+
parserOptions: {
|
|
15
|
+
projectService: true,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
13
18
|
rules: {
|
|
14
19
|
// Replace Airbnb 'brace-style' rule with '@typescript-eslint' version
|
|
15
20
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
|
|
16
21
|
'brace-style': 'off',
|
|
17
|
-
'@typescript-eslint/brace-style':
|
|
22
|
+
'@typescript-eslint/brace-style': stylistic_1.default.rules['brace-style'],
|
|
18
23
|
// Replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
|
|
19
24
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
20
25
|
camelcase: 'off',
|
|
@@ -42,13 +47,13 @@ const typescriptEslintRules = {
|
|
|
42
47
|
// The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
|
|
43
48
|
'comma-dangle': 'off',
|
|
44
49
|
'@typescript-eslint/comma-dangle': [
|
|
45
|
-
|
|
46
|
-
Object.assign(Object.assign({},
|
|
50
|
+
stylistic_1.default.rules['comma-dangle'][0],
|
|
51
|
+
Object.assign(Object.assign({}, stylistic_1.default.rules['comma-dangle'][1]), { enums: stylistic_1.default.rules['comma-dangle'][1].arrays, generics: stylistic_1.default.rules['comma-dangle'][1].arrays, tuples: stylistic_1.default.rules['comma-dangle'][1].arrays }),
|
|
47
52
|
],
|
|
48
53
|
// Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
|
|
49
54
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
|
|
50
55
|
'comma-spacing': 'off',
|
|
51
|
-
'@typescript-eslint/comma-spacing':
|
|
56
|
+
'@typescript-eslint/comma-spacing': stylistic_1.default.rules['comma-spacing'],
|
|
52
57
|
// Replace Airbnb 'default-param-last' rule with '@typescript-eslint' version
|
|
53
58
|
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/default-param-last.md
|
|
54
59
|
'default-param-last': 'off',
|
|
@@ -60,19 +65,15 @@ const typescriptEslintRules = {
|
|
|
60
65
|
// Replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
|
|
61
66
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
|
|
62
67
|
'func-call-spacing': 'off',
|
|
63
|
-
'@typescript-eslint/func-call-spacing':
|
|
68
|
+
'@typescript-eslint/func-call-spacing': stylistic_1.default.rules['func-call-spacing'],
|
|
64
69
|
// Replace Airbnb 'indent' rule with '@typescript-eslint' version
|
|
65
70
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
|
|
66
71
|
indent: 'off',
|
|
67
|
-
'@typescript-eslint/indent':
|
|
72
|
+
'@typescript-eslint/indent': stylistic_1.default.rules.indent,
|
|
68
73
|
// Replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
|
|
69
74
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
|
|
70
75
|
'keyword-spacing': 'off',
|
|
71
|
-
'@typescript-eslint/keyword-spacing':
|
|
72
|
-
// Replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
|
|
73
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
|
|
74
|
-
// 'lines-between-class-members': 'off',
|
|
75
|
-
// '@typescript-eslint/lines-between-class-members': styleRules.rules['lines-between-class-members'],
|
|
76
|
+
'@typescript-eslint/keyword-spacing': stylistic_1.default.rules['keyword-spacing'],
|
|
76
77
|
// Replace Airbnb 'no-array-constructor' rule with '@typescript-eslint' version
|
|
77
78
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
|
|
78
79
|
'no-array-constructor': 'off',
|
|
@@ -88,20 +89,16 @@ const typescriptEslintRules = {
|
|
|
88
89
|
// Replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
|
|
89
90
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
|
|
90
91
|
'no-extra-parens': 'off',
|
|
91
|
-
'@typescript-eslint/no-extra-parens':
|
|
92
|
+
'@typescript-eslint/no-extra-parens': stylistic_1.default.rules['no-extra-parens'],
|
|
92
93
|
// Replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
|
|
93
94
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
|
|
94
95
|
'no-extra-semi': 'off',
|
|
95
|
-
'@typescript-eslint/no-extra-semi':
|
|
96
|
+
'@typescript-eslint/no-extra-semi': stylistic_1.default.rules['no-extra-semi'],
|
|
96
97
|
// Replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
|
|
97
98
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
|
|
98
99
|
'no-implied-eval': 'off',
|
|
99
100
|
'no-new-func': 'off',
|
|
100
101
|
'@typescript-eslint/no-implied-eval': best_practices_1.default.rules['no-implied-eval'],
|
|
101
|
-
// Replace Airbnb 'no-loss-of-precision' rule with '@typescript-eslint' version
|
|
102
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
|
|
103
|
-
'no-loss-of-precision': 'off',
|
|
104
|
-
'@typescript-eslint/no-loss-of-precision': errors_1.default.rules['no-loss-of-precision'],
|
|
105
102
|
// Replace Airbnb 'no-loop-func' rule with '@typescript-eslint' version
|
|
106
103
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
|
|
107
104
|
'no-loop-func': 'off',
|
|
@@ -121,11 +118,11 @@ const typescriptEslintRules = {
|
|
|
121
118
|
// Replace Airbnb 'space-before-blocks' rule with '@typescript-eslint' version
|
|
122
119
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-blocks.md
|
|
123
120
|
'space-before-blocks': 'off',
|
|
124
|
-
'@typescript-eslint/space-before-blocks':
|
|
121
|
+
'@typescript-eslint/space-before-blocks': stylistic_1.default.rules['space-before-blocks'],
|
|
125
122
|
// Replace Airbnb 'no-throw-literal' rule with '@typescript-eslint' version
|
|
126
123
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-throw-literal.md
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
'no-throw-literal': 'off',
|
|
125
|
+
'@typescript-eslint/only-throw-error': best_practices_1.default.rules['no-throw-literal'],
|
|
129
126
|
// Replace Airbnb 'no-unused-expressions' rule with '@typescript-eslint' version
|
|
130
127
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
131
128
|
'no-unused-expressions': 'off',
|
|
@@ -145,34 +142,31 @@ const typescriptEslintRules = {
|
|
|
145
142
|
// Replace Airbnb 'quotes' rule with '@typescript-eslint' version
|
|
146
143
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
|
|
147
144
|
quotes: 'off',
|
|
148
|
-
'@typescript-eslint/quotes':
|
|
145
|
+
'@typescript-eslint/quotes': stylistic_1.default.rules.quotes,
|
|
149
146
|
// Replace Airbnb 'semi' rule with '@typescript-eslint' version
|
|
150
147
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
|
|
151
148
|
semi: 'off',
|
|
152
|
-
'@typescript-eslint/semi':
|
|
149
|
+
'@typescript-eslint/semi': stylistic_1.default.rules.semi,
|
|
153
150
|
// Replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
|
|
154
151
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
|
|
155
152
|
'space-before-function-paren': 'off',
|
|
156
|
-
'@typescript-eslint/space-before-function-paren':
|
|
153
|
+
'@typescript-eslint/space-before-function-paren': stylistic_1.default.rules['space-before-function-paren'],
|
|
157
154
|
// Replace Airbnb 'require-await' rule with '@typescript-eslint' version
|
|
158
155
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
159
156
|
'require-await': 'off',
|
|
160
157
|
'@typescript-eslint/require-await': best_practices_1.default.rules['require-await'],
|
|
161
158
|
// Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
|
|
162
159
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
163
|
-
|
|
164
|
-
'@typescript-eslint/return-await': [
|
|
165
|
-
best_practices_1.default.rules['no-return-await'],
|
|
166
|
-
'in-try-catch',
|
|
167
|
-
],
|
|
160
|
+
// Its Base rule is deprecated
|
|
161
|
+
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
168
162
|
// Replace Airbnb 'space-infix-ops' rule with '@typescript-eslint' version
|
|
169
163
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-infix-ops.md
|
|
170
164
|
'space-infix-ops': 'off',
|
|
171
|
-
'@typescript-eslint/space-infix-ops':
|
|
165
|
+
'@typescript-eslint/space-infix-ops': stylistic_1.default.rules['space-infix-ops'],
|
|
172
166
|
// Replace Airbnb 'object-curly-spacing' rule with '@typescript-eslint' version
|
|
173
167
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/object-curly-spacing.md
|
|
174
168
|
'object-curly-spacing': 'off',
|
|
175
|
-
'@typescript-eslint/object-curly-spacing':
|
|
169
|
+
'@typescript-eslint/object-curly-spacing': stylistic_1.default.rules['object-curly-spacing'],
|
|
176
170
|
},
|
|
177
171
|
};
|
|
178
172
|
exports.default = typescriptEslintRules;
|
package/dist/rules/variables.js
CHANGED
|
@@ -9,8 +9,6 @@ const variablesRules = {
|
|
|
9
9
|
rules: {
|
|
10
10
|
// enforce or disallow variable initializations at definition
|
|
11
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
12
|
// disallow deletion of variables
|
|
15
13
|
'no-delete-var': 'error',
|
|
16
14
|
// disallow labels that share a name with a variable
|