prefer-const should autofix, but it didn't
See original GitHub issuelet acorn = require("acorn"),
assert = require("chai").assert;
to
const acorn = require("acorn"),
assert = require("chai").assert;
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Fix all const warning flutter - dart - Stack Overflow
Simply right click on any of the warning in the problems tab in vscode and choose Add const modifiers everywhere in the file....
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 >eslint/eslint - Gitter
Hi all! I wanted to ask the best way to do the following: I want to create a plugin that will enable a...
Read more >Michael Mok on Twitter: "@dan_abramov I am in the middle of ...
Let's agree to never speak of this again and use a pre-commit autofix (in ... that I'm now having an inner debate if...
Read more >eslint-plugin-autofix - npm Package Health Analysis | Snyk
Name 🛠 Description
array‑bracket‑spacing 🛠 enforce consistent spacing inside array brackets
array‑element‑newline 🛠 enforce line breaks after each array element
arrow‑body‑style 🛠 require braces around arrow...
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
It looks like the issue is that the code doesn’t want to autofix if there are multiple declarators (under the assumption that if one declarator needs fixing but others don’t, it’s not clear how the fix should be applied).
However, we do have logic for autofixing if a destructuring assignment is completely convertible (all variables can be const).
So I could see this being treated as a bugfix, but I’ll defer to others in the team.
Kk working on this. Will have a PR over the next few days. Thanks for the clarification.