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

fix: use .ts instead of .d.ts #1

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

johannschopplich
Copy link
Contributor

@johannschopplich johannschopplich commented Oct 22, 2024

Hi there! Thanks for creating this repo.

I was reading a Total TypeScript newsletter the other day that explains, why declaration files .d.ts should never be used. It's an anti-pattern, so to speak. Especially since you use:

"skipLibCheck": true

Unfortunately, I can't find the newsletter online. But in a nutshell:

  • skipLibCheck must always be set to true (since you don't control the types of installed Node modules). meaning .d.ts files are actually never type-checked.
    • Which was actually new to me. Imagine all the possible type issues that are just hidden.
  • You can just use plain TypeScript files instead. They can do 99% of what .d.ts files can.

The only other resource I found was this article.

Copy link
Contributor

@fayazara fayazara left a comment

Choose a reason for hiding this comment

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

LGTM

@fayazara fayazara merged commit 0248441 into SupersaasHQ:main Oct 22, 2024
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