Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upError reported when destructuring with comments in place of skipped variables. #1244
Comments
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
May 30, 2019
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
May 30, 2019
stale
bot
closed this
Jun 6, 2019
This comment has been minimized.
This comment has been minimized.
|
In But you're right, that comments causing the rule to trigger is not ideal. Unfortunately, there is no way to tell ESLint to not treat this as an error. If you'd like to get this fixed, could you open an issue on the ESLint repo and see what the team thinks about adding an exception to allow a space when there's an inline Cheers! |
wjhir commentedFeb 1, 2019
When destructuring an array and skipping unused indices, I like to include a comment to annotate what's being skipped. When the destructuring is a single line and there is a comment either before the first item or after the last, it causes an unexpected error:
Expected consistent spacing (standard/array-bracket-even-spacing). This happens whether or not the brackets are padded with spaces. The error does not occur when the destructuring is split over multiple lines.Examples: