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
curly multi-or-nest incorrect example with a comment #12972
Comments
Nice find! From the documentation:
Given this heuristic, I don't think this should warn. That being said, it looks like the reason this isn't warning is because it ignores cases where there are comments (which I'm not sure is expected behavior). See demo here. |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
I would advocate for updating the documentation to match the behavior of the rule right now and to follow up with a separate PR if we decide that the behavior is incorrect. |
PR #13151 updates the docs to match the actual behavior. I'd vote to leave the rule as is. This could be unintended behavior, but fixing it looks like a big change for users now. |
Unfortunately, it looks like there wasn't enough interest from the team Thanks for contributing to ESLint and we appreciate your understanding. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Online Demo (v6.8.0)
What did you expect to happen?
In curly multi-or-nest documentation this is one of the examples of incorrect code (the last one).
What actually happened? Please include the actual, raw output from ESLint.
no errors.
Are you willing to submit a pull request to fix this bug?
I'm not sure should this be fixed in the rule or in the docs. This may be a bug, but I have concerns about the impact if we change the behavior now.
Relevant issue/PRs: #7538, #7539, #7597.
The intention was to allow this:
but I can't tell from the relevant discussions whether the intention was also to disallow the code that was added to the incorrect examples.
The text was updated successfully, but these errors were encountered: