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

Linter: plan for type checked rules? #509

Closed
JoshuaKGoldberg opened this issue Jul 3, 2023 · 3 comments
Closed

Linter: plan for type checked rules? #509

JoshuaKGoldberg opened this issue Jul 3, 2023 · 3 comments

Comments

@JoshuaKGoldberg
Copy link

Forking from #503: do you have a plan for type including type information in rules, equivalent to typescript-eslint's Linting with Type Information? E.g. integrating with https://github.com/dudykr/stc, or calling to TypeScript itself?

For reference, in typescript-eslint we've found that many of the more impactful rules have to be informed by type information. Not having it is a blocker for me and many others against using oxc for linting.

@Boshen
Copy link
Member

Boshen commented Jul 3, 2023

From what I have seen so far from larger internal projects, people stopped using type-checking rules due to its horrible performance, and non type-checking rules' performance are just bearable 😞

There is currently no way I can implement type-checking rules by invoking tsc APIs without degrading performance.

An approach I may try in the future is to re-use the type synthesis information from the ezno type checker. We already have some of the code here https://github.com/Boshen/oxc/tree/main/crates/oxc_type_synthesis

p.s I once tried porting the type inference part of tsc to Rust, and failed obviously.

@Boshen Boshen closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
@JoshuaKGoldberg
Copy link
Author

Oop, sorry, missed this notification a month ago - just seeing it now.

From what I have seen so far from larger internal projects, people stopped using type-checking rules due to its horrible performance, and non type-checking rules' performance are just bearable 😞

🤔 I would like to push back against that. We've been talking with quite a few teams -e.g. Bloomberg, cc @acutmore to keep me honest- that have successfully used type-checking rules. A much smaller example is https://github.com/typescript-eslint/typescript-eslint with .ts files in the range of around two thousand. Some of the common performance issues are documented on https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting.

I understand if this is out of scope for the project for now. The TypeScript type checker is indeed at JavaScript-speed and nobody's managed to get a fully working native-speed equivalent yet. But I just want to be clear that type checked rules are a feature many teams successfully use in today's systems, not an unusual edge case. 🙂

@Boshen
Copy link
Member

Boshen commented Jul 28, 2023

Nobody is against running type checking rules. The reality for large projects (in house monorepos with files in the >10k range) is that CI time goes from a few minutes to >30 minutes.

I'm still persuading @kaleidawave to get no-floating-promises working as the next prototype, we still have chances to push things forward!

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

No branches or pull requests

2 participants