Skip to content
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

[react] Including missing defaults to the react eslint #618

Merged
merged 3 commits into from
Dec 12, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/eslint-config-airbnb/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
// Prevent missing displayName in a React component definition
'react/display-name': 0,
// Enforce boolean attributes notation in JSX
'react/jsx-boolean-value': 2,
'react/jsx-boolean-value': [2, 'never'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we also add in a comment the URL of each of the rules?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was literally just about to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JORDAN SYNERGYYYYYYY

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those changes are great but i also meant URLs in comments inline in react.js

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the classic Double-J communication breakdown.

https://www.youtube.com/watch?v=f6WQLvRvtjs

// Enforce or disallow spaces inside of curly braces in JSX attributes
'react/jsx-curly-spacing': 0,
// Prevent duplicate props in JSX
Expand All @@ -31,7 +31,7 @@ module.exports = {
// Prevent usage of setState in componentDidMount
'react/no-did-mount-set-state': [2, 'allow-in-func'],
// Prevent usage of setState in componentDidUpdate
'react/no-did-update-set-state': 2,
'react/no-did-update-set-state': [2, 'allow-in-func'],
// Prevent multiple component definition per file
'react/no-multi-comp': 2,
// Prevent usage of unknown DOM property
Expand All @@ -56,6 +56,10 @@ module.exports = {
]
}],
// Prevent missing parentheses around multilines JSX
'react/wrap-multilines': 2
'react/wrap-multilines': [2, {
declaration: true,
assignment: true,
return: true
}]
}
};