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

Enable more eslint-plugin-react rules #4007

Merged
merged 2 commits into from
Jun 4, 2015
Merged

Conversation

bgw
Copy link
Contributor

@bgw bgw commented Jun 2, 2015

This should contain all the rules we probably want to use. This is divided into two commits to make it easier to review.

The wrap-multiline codemod commit was mostly made using:

$ codemod '^(?P<indent>[ \t]+)([^\s][^\n]*?[^(>])(\n(?P=indent)\s+<[^>]+>(\n(?P=indent)\s+[^\n]+)+>)' '\1\2 (\3\n\g<indent>)' -m -d src
$ codemod '^(?P<indent>[ \t]+)([^\s][^\n]*?[^(>])(\n(?P=indent)\s+<[^>]+(\n(?P=indent)\s+[^\n>]+)+/>)' '\1\2 (\3\n\g<indent>)' -m -d src

<WrapComponent>
<div />
<span />
</WrapComponent>;
</WrapComponent>
);
Copy link
Member

Choose a reason for hiding this comment

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

Our style guide actually says the opposite for these and we (usually) only wrap with parens at return statements. Might be worth forking the rule or seeing if we can get an option added upstream.

bgw added 2 commits June 4, 2015 09:43
This should contain all the rules we probably want to use, except
react/wrap-multilines, which requires a larger codemod, and would
clutter this commit.
Multiline jsx literals in a return should be paren-wrapped.
bgw added a commit that referenced this pull request Jun 4, 2015
Enable more eslint-plugin-react rules
@bgw bgw merged commit 9760e13 into facebook:master Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants