False-positive in prefer-const and array-destructuring
See original GitHub issueTell us about your environment
- ESLint Version: 3.18.0
- Node Version: 6.10.0
- npm Version: 4.4.4
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
{
"ecmaVersion": 7,
"rules": [
"prefer-const"
]
}
What did you do? Please include the actual source code causing the issue.
let predicate;
[typeNode.returnType, predicate] = foo();
What did you expect to happen?
No error
What actually happened? Please include the actual, raw output from ESLint.
2:23 - 'predicate' is never reassigned. Use 'const' instead. (prefer-const)
The rule should consider that it is not possible to actually make predicate a const here.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Destructuring assignment - JavaScript - MDN Web Docs
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from ...
Read more >prefer-const - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Typescript object destructuring is caught by ESLint no-unused ...
I have an object in Typescript that I am destructuring in order to extract a partial object. However, it fails ...
Read more >ESLint v2.0.0 released - ESLint中文文档
186e8f0 Update: Ignore camelcase in object destructuring (fixes #3185) (alberto) ... 361377f Fix: prefer-const false positive reading before writing (fixes ...
Read more >vue/no-ref-object-destructure
This rule also supports Reactivity Transform, but Reactivity Transform is an experimental feature and may have false positives due to future ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This seems like a pretty significant bug. I’d like to take a stab at fixing this.
I would like to look into this issue as well if no one is working on this 😃