From 274c8d570155a05b016980294d4204c5711bce86 Mon Sep 17 00:00:00 2001 From: David Petersen Date: Wed, 10 Nov 2021 17:05:21 -0600 Subject: [PATCH] [eslint config] [patch] set `namedComponents` option to match style guide Change the `namedComponents` option to `function-declaration` to match what the style guide requires. https://github.com/airbnb/javascript/commit/019e0f7e07477e85249e1d584f22773120c41b91#r60060792 --- packages/eslint-config-airbnb/rules/react.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index 71230fac71..4ece5a342c 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -524,9 +524,8 @@ module.exports = { // Enforce a specific function type for function components // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md - // TODO: investigate if setting namedComponents to expression vs declaration is problematic 'react/function-component-definition': ['error', { - namedComponents: 'function-expression', + namedComponents: ['function-declaration', 'function-expression'], unnamedComponents: 'function-expression', }],