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.

Eslint Plugin Prefer Let

See original GitHub issue

What does XO think about considering eslint-plugin-prefer-let? https://www.npmjs.com/package/eslint-plugin-prefer-let

Usage of the const keyword to bind an intermediate value of a computation places emphasis on the compiler and and its role in ensuring that a reference never changes. By contrast using let in the same situation reads, in plain English, the programmer’s intent to declare a name value binding.

It is this plugin’s opinion that preventing reassignment of let bindings is better accomplished as a linting rule.

I know this is typically not thought of as a “best practice”, but it is an interesting consideration and I thought it might be a happy addition to XO 😉

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pvdlgcommented, Mar 8, 2018

That’s mostly likely an issue to report on eslint-plugin-prefer-let. If the plugin has conflicts with other eslint rules, they should mention it in the doc so users could disable the problematic rules.

1reaction
pvdlgcommented, Mar 8, 2018

Thanks for the suggestion.

This plugin and the rule it enforces seems very very opinionated and far from being something widely accepted as a good practice. Therefore we most likely won’t add it in XO.

As you notice you can use it via configuration. As mentioned in the plugin documentation you have to use the plugin and the rule:

"xo": {
    "plugins": ["prefer-let"],
    "rules": {
        "prefer-let/prefer-let": 2
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-prefer-let - npm
An eslint plugin to encourage semantic of usage of let and const . Things being basically equal, code should speak to humans first,...
Read more >
cowboyd/eslint-plugin-prefer-let - GitHub
Prefer using `let` when binding names to values. Contribute to cowboyd/eslint-plugin-prefer-let development by creating an account on GitHub.
Read more >
eslint-plugin-prefer-let - npm package - Snyk
An eslint plugin to encourage semantic of usage of let and const . Things being basically equal, code should speak to humans first,...
Read more >
eslint-plugin-prefer-let - UNPKG
The CDN for eslint-plugin-prefer-let. ... eslint-plugin-prefer-let. Version: 0.0.0, 0.1.0, 1.0.0, 1.0.1, 1.0.2-37a5fdd, 1.0.2-447f893, 1.0.2-5eb4678 ...
Read more >
eslint-plugin-prefer-let - Bundlephobia
Find the size of javascript package eslint-plugin-prefer-let. Bundlephobia helps you find the performance impact of npm packages.
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