Skip to content

Commit ccef929

Browse files
committed
Merge pull request #575 from SimenB/patch-1
[eslint config] [minor] Allow multiple stateless components in a single file
2 parents 74561b6 + 96ef087 commit ccef929

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ module.exports = {
9191
'react/no-is-mounted': 2,
9292
// Prevent multiple component definition per file
9393
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
94-
'react/no-multi-comp': [2, {'ignoreStateless': false}],
94+
'react/no-multi-comp': [2, {'ignoreStateless': true}],
9595
// Prevent usage of setState
9696
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
9797
'react/no-set-state': 0,

react/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
## Basic Rules
2222

2323
- Only include one React component per file.
24+
- However, multiple [Stateless, or Pure, Components](https://facebook.github.io/react/docs/reusable-components.html#stateless-functions) are allowed per file. eslint rule: [`react/no-multi-comp`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md#ignorestateless).
2425
- Always use JSX syntax.
2526
- Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.
2627

0 commit comments

Comments
 (0)