-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
id-length
does not check identifier in array pattern
#12832
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
yeonjuan
added
bug
ESLint is working incorrectly
triage
An ESLint team member will look at this issue soon
labels
Jan 27, 2020
kaicataldo
added
accepted
There is consensus among the team that this change meets the criteria for inclusion
rule
Relates to ESLint's core rules
and removed
triage
An ESLint team member will look at this issue soon
labels
Jan 27, 2020
Thanks for reporting this! Agreed that this is a bug. The rule already warns for this alternative equivalent: const a = foo[0]; See demo here. |
yeonjuan
added a commit
that referenced
this issue
Jan 28, 2020
2 tasks
yeonjuan
changed the title
Jan 28, 2020
id-length
does not check identifier in array destructuring.id-length
does not check identifier in array pattern
2 tasks
To noteAfter #12881 merged, there are false negative examples in the At Examples of correct code... /*eslint id-length: "error"*/ // default is minimum 2-chars ({ "min": 2 })
/*eslint-env es6*/
// ...
var { prop: [x] } = {}; // false negative, It should be placed in an incorrect example
// ... This will be fixed in #12839. |
kaicataldo
pushed a commit
that referenced
this issue
Feb 28, 2020
montmanu
pushed a commit
to montmanu/eslint
that referenced
this issue
Mar 4, 2020
…12832) (eslint#12839) * Update: check identifier in array pattern in id-length (fixes eslint#12832) * fix wrong test case * Update documentation
eslint-deprecated
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Aug 28, 2020
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
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Online demo
What did you expect to happen?
Warn about short named identifier
a
;What actually happened? Please include the actual, raw output from ESLint.
No error.
Are you willing to submit a pull request to fix this bug?
Yes. I already finished the implementation.(locally)
But, I have a question before pull request.
By the docs in id-length, there is an example in the correct example section showing the array pattern with the short identifier
x
.In my understanding, the
x
is an identifier created by array destructuring so it should be checked by this rule.Am I missing something? Is it intended behavior?
The text was updated successfully, but these errors were encountered: