question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prefer-const should autofix, but it didn't

See original GitHub issue
let acorn = require("acorn"),
    assert = require("chai").assert;

to

const acorn = require("acorn"),
    assert = require("chai").assert;

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
platinumazurecommented, Jul 9, 2018

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.

1reaction
sstern6commented, Oct 15, 2018

Kk working on this. Will have a PR over the next few days. Thanks for the clarification.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found