Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Rewrite 'no-shadowed-variable' #2339

Closed

Conversation

andy-hanson
Copy link
Contributor

PR checklist

Overview of change:

Complete rewrite of no-shadowed-variable.
Now checks for shadowing of types too (e.g. interface Foo { m<Foo>(): Foo }).
Also now no ignores variables named 'this'.

@@ -174,7 +174,7 @@ function resolveConfigurationPath(filePath: string, relativeTo?: string) {
} catch (err) {
try {
return require.resolve(filePath);
} catch (err) {
} catch (anotherErr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably add some options to ignore catched exceptions and maybe variable names matching a regex. That way you don't need a new name for nested try...catch blocks or errorback style callbacks

public createScope() {
return new Set();
}
class Walker extends Lint.AbstractWalker<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get me wrong, but to me this implementation seems to be overly complex for this use case.
Do you mind if I try to come up with a simpler approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Be sure to test for type parameters, namespaces, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajafff Bump

@ajafff
Copy link
Contributor

ajafff commented Apr 16, 2017

@andy-hanson thanks for the reminder and sorry for the delay. I'll have time to look into this early next week. Should be ready no later than on tuesday.

@adidahiya
Copy link
Contributor

closing in favor of #2598

@adidahiya adidahiya closed this May 31, 2017
@andy-hanson andy-hanson deleted the no-shadowed-variable branch May 31, 2017 22:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants