Eslint Plugin Prefer Let
See original GitHub issueWhat 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:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top 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 >
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 Free
Top 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
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.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: