-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Bug with object spread and computed-property-even-spacing #3
Comments
Looks like a bug. That code should work. @xjamundx - any ideas? |
Okay, so we need to update the rule to take into account object-spread, which just came out. I'll take a stab at it today! The other one seems like a bug. Will address both. |
So I can't reproduce this with raw ESLint using the plugins tests, which means it could be a number of things.
When I run standard 5.0.0 on the file with your code examples I get the following:
I will send up a PR proving the plugin is capable of handling this and @feross can you see if it's a standard issue or something else? |
Tests: obj/rest spread and computed-property rule (fixes #3)
I'm not sure why Not sure what's going on here. I'm not very motivated to fix this since it's an experimental, likely-to-change language feature. But if there's a simple PR to fix this, I'm happy to merge it. |
Possibly related: |
Seeing this as well with
|
It's quite possibly a |
I'm having the same problem standard/standard#226. Here's exactly how to reproduce: (in a new directory)
put the following content in app.js import fn from 'fn'
export default function something (args) {
return fn({
field: 'blah',
...args
})
} install standard 4 and babel-eslint (to prove it's not babel-eslint):
create
add {
"standard": {
"parser": "babel-eslint"
}
} run
now upgrade to standard 5 to verify error:
run standard again to verify error:
Error received:
So I don't think it's |
For clarity this is 99% likely a |
okay looking into this in-depth today |
Related: jsx-eslint/eslint-plugin-react#187 So @feross if you want this to work in
Once you do that the code above should run fine with |
Something we didn't since object spread wasn't standard yet - https://github.com/babel/babel-eslint/blob/85e3f82ec096499895cc12ab8955bf63b216324f/acorn-to-esprima.js#L178-L191- Oh - so it's checking for computed properties and babel-eslint made Maybe we don't need to make some of these changes @sebmck? |
@xjamundx Nice work debugging this. I'll update once |
This is fixed in standard 5.1.0. |
@feross Still getting an error: // works
const {a, ...b} = c
// works
const { a } = b
// doesn't work
const { a, ...b } = c
|
haha. it never ends. i'll check it out in a bit. |
this is with babel-eslint right? I'l probably have to make a change to fix this |
Verified the fix - PR is babel/babel-eslint#165 |
Ok should be fixed in babel-eslint |
@cesarandreu let me know if it still fails |
It's working properly now, thanks @hzoo :D. |
The following two examples are giving me errors:
Bug or intentional?
Using [email protected] and [email protected].
The text was updated successfully, but these errors were encountered: