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

comma-dangle does not catch dangling commas in object destructuring #2911

Closed
feross opened this issue Jul 2, 2015 · 1 comment · Fixed by DavidKindler/meteor#3 · May be fixed by iamstoick/javascript#11
Closed

comma-dangle does not catch dangling commas in object destructuring #2911

feross opened this issue Jul 2, 2015 · 1 comment · Fixed by DavidKindler/meteor#3 · May be fixed by iamstoick/javascript#11
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@feross
Copy link
Contributor

feross commented Jul 2, 2015

With this rule:

"comma-dangle": [2, "never"]

I expect an error with this code (using object destructuring):

var obj = {}
const {
  prop1,
  prop2,
} = obj

For comparison, I do get an error (as expected) with this code (using an object literal):

var prop1 = 1
var prop2 = 2
const obj = {
  prop1,
  prop2,
}
@nzakas nzakas added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Jul 3, 2015
@nzakas
Copy link
Member

nzakas commented Jul 3, 2015

Makes sense - destructured objects are a different AST node, so we probably didn't update this rule for it.

@lo1tuma lo1tuma closed this as completed in 5e0682c Jul 4, 2015
ilyavolodin added a commit that referenced this issue Jul 4, 2015
Fix: add destructuring support to comma-dangle rule (fixes #2911)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
2 participants