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

feat(typescript-estree): allow erroring on TypeScript syntactic diagn… #6271

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Dec 24, 2022

PR Checklist

Overview

Adds a TypeScriptIssueDetection enum so typescript-estree can be told to call program.getSyntacticDiagnostics(ast) but not program.getSemanticDiagnostics(ast).

Note that this is partially in conflict with #6066. That PR removes the partial program; this PR explicitly uses it.

It would be nice to have performance testing in place (#6218). I removed all type checking from .eslintrc.js (recommended-requiring-type-checking, deprecation/deprecation, and a few assorted rules, deleted inline commends referring to type-checked rules, and ran hyperfine "npx eslint .":

  • This PR, only checking syntactic diagnostics:
    Time (mean ± σ): 5.763 s ± 0.103 s [User: 9.764 s, System: 0.633 s]
    Range (min … max): 5.707 s … 6.052 s 10 runs
    
  • This PR, checking syntactic and semantic diagnostics:
    Time (mean ± σ): 6.048 s ± 0.352 s [User: 9.987 s, System: 0.666 s]
    Range (min … max): 5.767 s … 6.967 s 10 runs
    
  • feat: remove partial type-information program #6066:
    Time (mean ± σ): 5.543 s ± 0.074 s [User: 9.191 s, System: 0.609 s]
    Range (min … max): 5.482 s … 5.747 s 10 runs
    

So, a 4% slowdown penalty for asking for syntactic diagnostics? That might just be worth it.

Either way, filed microsoft/TypeScript#52011 about some syntactic issues being reported as semantic diagnostics.

Competitor/sibling to #6247.

@nx-cloud
Copy link

nx-cloud bot commented Dec 24, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 7d1ac25. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
Node 14 - nx test typescript-estree --coverage=false
✅ Successfully ran 43 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

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

1 participant