-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -500,6 +500,35 @@ module.exports = { | |
// Enforce that props are read-only | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md | ||
'react/prefer-read-only-props': 'off', | ||
|
||
// Prevent usage of `javascript:` URLs | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-script-url.md | ||
// TODO: enable, semver-major | ||
'react/jsx-no-script-url': ['off', [ | ||
{ | ||
name: 'Link', | ||
props: ['to'], | ||
}, | ||
]], | ||
|
||
// Disallow unnecessary fragments | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md | ||
// TODO: enable, semver-major | ||
'react/jsx-no-useless-fragment': 'off', | ||
|
||
// Prevent adjacent inline elements not separated by whitespace | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md | ||
// TODO: enable? semver-major | ||
'react/no-adjacent-inline-elements': 'off', | ||
|
||
// Enforce a specific function type for function components | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md | ||
// TODO: enable! semver-minor, but do it in a major to be safe | ||
// TODO: investigate if setting namedComponents to expression vs declaration is problematic | ||
'react/function-component-definition': ['off', { | ||
namedComponents: 'function-expression', | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ljharb
Author
Collaborator
|
||
unnamedComponents: 'function-expression', | ||
}], | ||
}, | ||
|
||
settings: { | ||
|
It seems like using the
function-expression
option here conflicts with all the examples in the style guide.In the example code for the rule
In the style guide almost every component is defined like:
Unless I am missing something with the rule as is it will complain about that and want to define it as:
Am I missing something or should this be set to
function-declaration
?