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
array-bracket-newline doesn't count multiline comment as multiline #9211
Comments
Thanks for the report. I can reproduce this issue. |
What is the intended behaviour here? Should the original example be considered practically the same as ...
... ? (i.e. The array in the original example technically doesn't have elements on a new line because all the new lines are part of the comment, which isn't an element.) |
Based on the documentation, it seems like newlines should only be required in the brackets "if there are line breaks inside elements or between elements". Since the array in the example doesn't have any elements, there aren't any line breaks inside elements or between elements. So I think linkebreaks should be disallowed in this example, which means that the original code should be considered correct because it doesn't have linebreaks after the |
This might be another case where it could make sense to work based on token/comment line breaks instead of element line breaks. |
I have a PR to address this. Any reviews are welcome. |
Awesome, thank you! Confirmed working on my codebase. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
no warnings
What actually happened? Please include the actual, raw output from ESLint.
The text was updated successfully, but these errors were encountered: