From bca94c45b5f66481820e486d1081ad4399a34ebe Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Wed, 8 May 2019 20:51:03 +1000 Subject: [PATCH] fix: arrow-parens rule breaking TS syntax for HOC in fix mode BREAKING CHANGE: parentheses are no longer required for block body --- lib/shared.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/shared.js b/lib/shared.js index 12a414c..85ccf0d 100644 --- a/lib/shared.js +++ b/lib/shared.js @@ -12,6 +12,16 @@ module.exports = { "import/extensions": [".js", ".ts", ".mjs"], }, rules: { + "arrow-parens": [ + "error", + "as-needed", + { + // `requireForBlockBody` should be `true` (as Airbnb sets this to `true`), however it causes problems with HOC syntax in TS + // https://github.com/iamturns/eslint-config-airbnb-typescript/issues/8 + requireForBlockBody: false, + }, + ], + // Replace Airbnb 'camelcase' rule with '@typescript-eslint' version // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/camelcase.md camelcase: "off",