eslint-config-airbnb-extended 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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': style_1.default.rules['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
- style_1.default.rules['comma-dangle'][0],
46
- 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 }),
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': style_1.default.rules['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': style_1.default.rules['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': style_1.default.rules.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': style_1.default.rules['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': errors_1.default.rules['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': errors_1.default.rules['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': style_1.default.rules['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
- // 'no-throw-literal': 'off',
128
- // '@typescript-eslint/no-throw-literal': bestPracticesRules.rules['no-throw-literal'],
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': style_1.default.rules.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': style_1.default.rules.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': style_1.default.rules['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
- 'no-return-await': 'off',
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': style_1.default.rules['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': style_1.default.rules['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;
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-airbnb-extended",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Eslint Airbnb Config Extended",
5
5
  "keywords": [
6
6
  "eslint",
@@ -38,13 +38,13 @@
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-x": "^4.10.1",
41
+ "eslint-plugin-import-x": "^4.10.2",
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",
45
- "tsc-alias": "^1.8.13",
46
- "typescript": "^5.8.2",
47
- "typescript-eslint": "^8.29.0"
45
+ "tsc-alias": "^1.8.14",
46
+ "typescript": "^5.8.3",
47
+ "typescript-eslint": "^8.29.1"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@next/eslint-plugin-next": "^15.2.4",