Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit bca94c4

Browse files
committed
fix: arrow-parens rule breaking TS syntax for HOC in fix mode
BREAKING CHANGE: parentheses are no longer required for block body
1 parent 5413180 commit bca94c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/shared.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ module.exports = {
1212
"import/extensions": [".js", ".ts", ".mjs"],
1313
},
1414
rules: {
15+
"arrow-parens": [
16+
"error",
17+
"as-needed",
18+
{
19+
// `requireForBlockBody` should be `true` (as Airbnb sets this to `true`), however it causes problems with HOC syntax in TS
20+
// https://github.com/iamturns/eslint-config-airbnb-typescript/issues/8
21+
requireForBlockBody: false,
22+
},
23+
],
24+
1525
// Replace Airbnb 'camelcase' rule with '@typescript-eslint' version
1626
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md
1727
camelcase: "off",

0 commit comments

Comments
 (0)