Skip to content

Enable no-shadow ESLint rule #64

@alex-ketch

Description

@alex-ketch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions