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

Improve linting to add @typescript-eslint/no-shadow #1882

Closed
johnbley opened this issue Jan 28, 2021 · 0 comments · Fixed by #1922
Closed

Improve linting to add @typescript-eslint/no-shadow #1882

johnbley opened this issue Jan 28, 2021 · 0 comments · Fixed by #1922

Comments

@johnbley
Copy link
Member

Based on @mhennoch discovering a logic bug in #1868 which was caused by shadowing, we should improve our linting. I took a stab at adding

  "no-shadow": "off",
  "@typescript-eslint/no-shadow": ["warn"],

but a few complications arose which made this more than an easy 15-minute PR:

  • @typescript-eslint/no-shadow requires updating gts from 2.0.2 (latest is 3.0.1), which brings in many other changes and would require additional lint:fix runs and/or tweaking rule sets.
  • @typescript-eslint/no-shadow does appear to have some false positives, namely in testing code where it is common to reuse variable names in multiple it blocks. I would recommend the rule being warn for now based on that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant