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

Linter does not work with two default function arguments #305

Closed
KevinGrandon opened this issue Oct 25, 2015 · 1 comment

Comments

@KevinGrandon
Copy link

commented Oct 25, 2015

I'm seeing weird behavior when passing two arguments which default to a fat arrow function. This is linting correctly for me when using vanilla eslint, so my guess is that something between standard and eslint is causing this to fail (though there is a chance that it is an eslint problem if some config is triggering it). Opening this to hopefully track it down further and see if anyone has an idea of what's wrong.

// Lints correctly:
var workingLinter = ({
  foo,
  bar = x => x
}) => window.alert('it worked.')

workingLinter()


// Lints incorrectly:
// Error: Parsing error: Unexpected token =>
var brokenLinter = ({
  foo,
  bar = x => x,
  baz = x => x
}) => window.alert('it broke.')

brokenLinter()
@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

This works fine on the v6 branch, so it sounds like the eslint AST parser has gotten better and can handle this now.

standard v6 will be released very soon.

@feross feross closed this Feb 4, 2016

@feross feross added the bug label Feb 4, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

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.