Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable no-shadow ESLint rule #64

Open
alex-ketch opened this issue Feb 28, 2020 · 2 comments
Open

Enable no-shadow ESLint rule #64

alex-ketch opened this issue Feb 28, 2020 · 2 comments

Comments

@alex-ketch
Copy link
Collaborator

A tangential note for the JS, I think we should enable the ESLint no-shadow rule to avoid bugs and simplifying process for reading code.

Originally posted by @alex-ketch in stencila/thema#84


Motivation: From the rule reference

Shadowing is the process by which a local variable shares the same name as a variable in its containing scope. For example:

var a = 3;
function b() {
   var a = 10;
}

In this case, the variable a inside of b() is shadowing the variable a in the global scope. This can cause confusion while reading the code and it's impossible to access the global variable.

@alex-ketch alex-ketch added this to Backlog in Stencila Roadmap via automation Feb 28, 2020
Stencila Roadmap automation moved this from Backlog to Done May 27, 2020
alex-ketch added a commit that referenced this issue May 27, 2020
This reverts commit 812c8f2.
This is because the rule currently emits a lot of false-positives.
eslint/eslint#12893
@alex-ketch
Copy link
Collaborator Author

Reverting this change in 3cd10c6 due to large number of false positive errors
See eslint/eslint#12893

@alex-ketch alex-ketch reopened this May 27, 2020
Stencila Roadmap automation moved this from Done to In progress May 27, 2020
@alex-ketch alex-ketch moved this from In progress to Backlog in Stencila Roadmap Jun 5, 2020
@alex-ketch
Copy link
Collaborator Author

New issue to track issue with false positives: eslint/eslint#14963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Stencila Roadmap
  
Backlog
Development

No branches or pull requests

1 participant