mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 00:28:25 -05:00
Merge pull request #575 from SimenB/patch-1
[eslint config] [minor] Allow multiple stateless components in a single file
This commit is contained in:
2
packages/eslint-config-airbnb/rules/react.js
vendored
2
packages/eslint-config-airbnb/rules/react.js
vendored
@@ -91,7 +91,7 @@ module.exports = {
|
||||
'react/no-is-mounted': 2,
|
||||
// Prevent multiple component definition per file
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
||||
'react/no-multi-comp': [2, {'ignoreStateless': false}],
|
||||
'react/no-multi-comp': [2, {'ignoreStateless': true}],
|
||||
// Prevent usage of setState
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
|
||||
'react/no-set-state': 0,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
## Basic Rules
|
||||
|
||||
- Only include one React component per file.
|
||||
- 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).
|
||||
- Always use JSX syntax.
|
||||
- Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user