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
Fix: id-blacklist should ignore ObjectPatterns (fixes #12787) #12792
Changes from all commits
ec3983c
c25321a
8e340c3
0e7b9a7
871fc8c
bccd6eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,26 @@ ruleTester.run("id-blacklist", rule, { | |
code: "var obj = { key: foo.bar };", | ||
options: ["f", "fo", "fooo", "b", "ba", "barr", "bazz", "bingg"] | ||
}, | ||
{ | ||
code: "const {foo: bar} = baz", | ||
kaicataldo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
options: ["foo", "bar"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jpramassini
I got it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this should definitely be invalid at some point due to the spirit of the rule. I added that to try and illustrate for now that that's intended behavior for now. Should I make a separate issue to make sure that gets tracked? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Maybe it would be welcomed, but it is up to you. :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An issue would be great! |
||
parserOptions: { ecmaVersion: 6 } | ||
}, | ||
{ | ||
code: "const {foo: {bar: baz}} = qux", | ||
options: ["foo", "bar", "baz"], | ||
parserOptions: { ecmaVersion: 6 } | ||
}, | ||
{ | ||
code: "function foo({ bar: baz }) {}", | ||
options: ["bar", "baz"], | ||
parserOptions: { ecmaVersion: 6 } | ||
}, | ||
{ | ||
code: "function foo({ bar: {baz: qux} }) {}", | ||
options: ["bar", "baz", "qux"], | ||
parserOptions: { ecmaVersion: 6 } | ||
}, | ||
{ | ||
code: "var arr = [foo.bar];", | ||
options: ["f", "fo", "fooo", "b", "ba", "barr", "bazz", "bingg"] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind undoing this? This is referring to the following block and I think it's clearer to have it indented as it was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pushed a commit that should fix this, the commit has these lined up properly but for some reason the diff doesn't seem to have updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see that. Strange :/ Seems like something on GitHub's end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it. This is the first time I've had this happen. 🤷♂