-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Disable arrow-body-style
rule
#71
Comments
I suspect they wouldn't mind a quick PR:) |
I think this is another manifestation of prettier/eslint-plugin-prettier#65 |
In other words, I expect this issue to play out like this one: #31 |
You should be able to manually add the missing paren and then it should work fine. |
I don't see how it's acceptable to suggest that a valid workaround is to fix the invalid JS that prettier outputs :-/ it's reasonable to ask users to apply the prettier config (disabling conflicting rules) - why not include this one in it? |
As far as I understand, Prettier does not output invalid JS. (Try it with Prettier only!) It’s ESLint’s So the way I see it, arrow-body-style is compatible with Prettier. A fix should go to ESlint (and/or eslint-plugin-prettier, possibly). Does that make sense? |
Sure, it's clearly a bug with the combination of eslint and prettier - but that's precisely what this config is meant to address, disabling the rules that conflict. I don't have an opinion on where the fix should go, but it's very urgent imo to stop |
The thing is, this could happen to any rule with autofix. So far we’ve run into 2 rules that trigger this issue. Hopefully that’s the only two, but who knows. Maybe we should put them into the “Special rules” category so that the CLI helper tool warns about them. |
Sure :-) I'm not suggesting a general solution, just something that fixes the issue with these two known rules. |
I like the idea of logging a warning in the CLI tool for rules that cause this problem because it would at least surface the issue to developers who can then choose to either turn the rule off or manually fix. |
(Actually, it is. Run the tools separately. You don’t have to add the paren manually.) |
Telling devs to run the tools separately isn't tenable for us, either. |
arrow-body-style (and prefer-arrow-callback) are now disabled by default in v4.0.0. See the docs for more information. |
I opened a similar issue in React Boilerplate before I learned from this repo's readme that it's a known bug. |
When using the
arrow-body-style
rule along with the Prettier, the output can result in invalid code.Here's a thread with a working example: airbnb/javascript#1987
Since prettier handles arrow style well, can we switch this rule off in this repo?
arrow-body-style
config that results in invalid code:code
eslint config:
The text was updated successfully, but these errors were encountered: