Skip to content

Commit

Permalink
[eslint config] [patch] set namedComponents option to match style g…
Browse files Browse the repository at this point in the history
…uide

Change the `namedComponents` option to `function-declaration` to match what the style guide requires.

019e0f7#r60060792
  • Loading branch information
petersendidit authored and ljharb committed Nov 10, 2021
1 parent 38bc026 commit 274c8d5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/eslint-config-airbnb/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}],

Expand Down

0 comments on commit 274c8d5

Please sign in to comment.