-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request for some extra rules #1217
Comments
Thanks! 1, 2, and 3 are more appropriate for
|
There is currently an open issue for 6 (#985) |
Thanks, I didn't aware of Since #985 already covers 6, I'll later file a separate issue for 7, closing this now |
We are currently creating a react code style guide, there are some rules we find useful but not covered by eslint-plugin-react:
Use a index module for cross-directory component import
Warns on:
Not warn on:
Use default export for component jsx file
Warns on:
Not warn on:
Default exported comopnent must have the same name of its filename
Warns on:
Not warn on:
An
ignoreAnonymouse
flag can be set to ignore stateless component without a nameUse static properties to declare
propTypes
,defaultProps
, etcWarns on:
Not warn on:
Do not import react when only JSX syntax is used
Opposite to existing
react-in-jsx-scope
rule, this warns whenreact
is imported but not explicitly used, this can be useful when using babel-plugin-react-requireDo not implement
shouldComponentUpdate
for components which extendPureComponent
See React issue
Check for jsx's depth
We want to restrict jsx to a depth of 3 or 4, this is something like restricting nested block in common js code
Forbid any non-primitive expression in jsx props
Any expression except primitive values can cause shallow compare in
PureComponent
to break, this may include function expression, function bind (both.bind
call and::
operator), object or array literals, function calls, etc...The text was updated successfully, but these errors were encountered: