From a118bb9015dc27680d4cbf06dc8d5e3e1c08eb43 Mon Sep 17 00:00:00 2001 From: David Petersen Date: Wed, 10 Nov 2021 17:05:21 -0600 Subject: [PATCH] [eslint config] 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..bdc8fcb473 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', unnamedComponents: 'function-expression', }],