Community
Participate
Working Groups
Orion's current "no-redeclare" rule does too much. It warns about redeclaration of variables in the same scope (which is OK): > function f() { > var blah; > var blah; // "'blah' is already defined" > } .. But it also warns about shadowing (which is supposed to be the job of the "no-shadow" rule): > function blah() {} > > function g() { > var blah; // "'blah' is already defined" > } ... But strangely, it only complains about shadowing when a function declaration is shadowed. If a variable shadows another variable, or a function declaration shadows a variable, there is no warning: > var blah; > > function f() { > var blah; // not flagged > } To stay closer to upstream ESLint: * no-redeclare should *only* check for redeclaration within a single scope * The shadowing checks should be moved into a new "no-shadow" rule * no-shadow should consider shadowed variables, not just functions Upstream docs: [1] http://eslint.org/docs/rules/no-redeclare.html [2] eslint.org/docs/rules/no-redeclare.html
[2] http://eslint.org/docs/rules/no-shadow.html
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e23ee9d