add variable ignore list for `block-scoped-var`
See original GitHub issueThe version of ESLint you are using. v6.8.0
The problem you want to solve.
block-scoped-var
does not offer a progressive path to enable this rule.
Therefore, users have to fix all existing violations in order to enable this rule.
For a large pre-ECMAScript 2015 codebase, it is quite difficult to fix all existing violations and enable this rule all at once.
Your take on the correct solution to problem.
Similar to no-unused-vars
, have an option to add variables to ignore. By doing this way,
- we don’t make any breaking changes. (not providing variable ignore list will still work as intended)
- we allow users to enable this rule immediately
Are you willing to submit a pull request to implement this change? Yes
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
block-scoped-var - ESLint - Pluggable JavaScript Linter
The block-scoped-var rule generates warnings when variables are used outside of the block in which they were defined. This emulates C-style block scope....
Read more >JavaScript let: Declaring Block-Scoped Variables
This tutorial introduces you to a new way to declare block-scoped variables using JavaScript let and explains the temporal death zone (TDZ) concept...
Read more >Re-declaration of block scoped loop variable inside the loop
I recently came across a piece of code that has me confused about the block scoped variables declared with let keyword inside a...
Read more >The old "var" - The Modern JavaScript Tutorial
“var” has no block scope. Variables, declared with var , are either function-scoped or global-scoped. They are visible through blocks.
Read more >Documentation - Variable Declaration - TypeScript
When a variable is declared using let , it uses what some call lexical-scoping or block-scoping. Unlike variables declared with var whose scopes...
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
Hi @bcko 😃
I’m not strongly opposed to this proposal. But maybe some alternatives can help you. What about the setting error level with wran or using eslint-disable comment? ( + running cli --max-warning)
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.