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

lint: leave no-undef checking up to TypeScript #24726

Merged
merged 1 commit into from
Apr 27, 2022
Merged

lint: leave no-undef checking up to TypeScript #24726

merged 1 commit into from
Apr 27, 2022

Conversation

steveluscher
Copy link
Contributor

Problem

  • When something is undefined, you get both a TypeScript error and a lint error.
  • When something is known to TypeScript (eg. through a @types def) you still get a lint error.

TypeScript ESLint recommends that you leave definedness checking up to TypeScript itself: https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors

This PR has the nice side benefit of making all the red underlines go away in tests, since we in fact do have @types/mocha installed.

Summary of Changes

Disable no-undef in ESLint.

@codecov
Copy link

codecov bot commented Apr 27, 2022

Codecov Report

Merging #24726 (b514d6b) into master (2be4ee3) will not change coverage.
The diff coverage is n/a.

❗ Current head b514d6b differs from pull request most recent head 2d2be6f. Consider uploading reports for the commit 2d2be6f to get more accurate results

@@           Coverage Diff           @@
##           master   #24726   +/-   ##
=======================================
  Coverage    70.0%    70.0%           
=======================================
  Files          37       37           
  Lines        2301     2301           
  Branches      325      325           
=======================================
  Hits         1613     1613           
  Misses        573      573           
  Partials      115      115           

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 this pull request may close these issues.

2 participants