-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
feat: false negative with onlyDeclarations
+ properties
in id-match
#15431
Conversation
694e90c
to
8dad653
Compare
onlyDeclarations
in id-match
onlyDeclarations
+ properties
in id-match
onlyDeclarations
+ properties
in id-match
onlyDeclarations
+ properties
in id-match
I changed the title to |
tests/lib/rules/id-match.js
Outdated
{ | ||
code: ` | ||
const foo = { | ||
[a]: 1, | ||
}; | ||
`, | ||
options: ["^[^a]", { | ||
properties: false, | ||
onlyDeclarations: false | ||
}], | ||
parserOptions: { ecmaVersion: 2022 } | ||
}, |
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.
This should be invalid, but that's another bug. It might be best to just remove this test case for now, and revisit this rule at some point. In particular, L219-L249 looks broken.
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.
We should create a separate issue to track it.
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Fixes #15123
Report invalid
property
names forObjectExpressions
whenproperty: true
, regardless the value ofonlyDeclaration
option.Before - Online Demo
After
Is there anything you'd like reviewers to focus on?
No