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

Destructuring with empty sections throws off standard into an endless loop #1243

Closed
lukasoppermann opened this issue Jan 27, 2019 · 2 comments

Comments

@lukasoppermann
Copy link
Contributor

commented Jan 27, 2019

What version of standard?

  • typescript@3.2.4
  • typescript-eslint-parser@22.0.0
  • standard@12.0.1
    standard --parser typescript-eslint-parser --plugin typescript

What operating system, Node.js, and npm version?

  • Mac OSX
  • Node v11.7.0
  • NPM 6.5.0

What actually happened?

I have this line of code:

Promise.all([homepage, litHtml, layout]).then(([homepageHtml, , ]) => {
The error I get is Expected consistent spacing. However if I remove the space after the last comma, I get space missing.

So I am at a loss at what to do. Thanks for your help.

@LinusU

This comment has been minimized.

Copy link
Member

commented Jan 29, 2019

I'm not exactly sure on what you are trying to do with the commas there 🤔

The only reason I can see to have empty elements is to skip certain elements and then get a value at the end. But in your case, you don't have a final variable, and this you could just write it like this?

Promise.all([homepage, litHtml, layout]).then(([homepageHtml]) => {
@lukasoppermann

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2019

Darn, that is of course correct. Thanks for your help.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 29, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.