Skip to content

Commit 274c8d5

Browse files
petersendiditljharb
authored andcommitted
[eslint config] [patch] set namedComponents option to match style guide
Change the `namedComponents` option to `function-declaration` to match what the style guide requires. 019e0f7#r60060792
1 parent 38bc026 commit 274c8d5

File tree

1 file changed

+1
-2
lines changed
  • packages/eslint-config-airbnb/rules

1 file changed

+1
-2
lines changed

packages/eslint-config-airbnb/rules/react.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,8 @@ module.exports = {
524524

525525
// Enforce a specific function type for function components
526526
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
527-
// TODO: investigate if setting namedComponents to expression vs declaration is problematic
528527
'react/function-component-definition': ['error', {
529-
namedComponents: 'function-expression',
528+
namedComponents: ['function-declaration', 'function-expression'],
530529
unnamedComponents: 'function-expression',
531530
}],
532531

0 commit comments

Comments
 (0)