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

Migrate to Typescript #8

Closed
farooqkz opened this issue Mar 4, 2023 · 4 comments · Fixed by #12
Closed

Migrate to Typescript #8

farooqkz opened this issue Mar 4, 2023 · 4 comments · Fixed by #12
Assignees

Comments

@farooqkz
Copy link
Owner

farooqkz commented Mar 4, 2023

This will help a lot in reducing bugs. I will do it myself as I have to learn.

@Simon-Laux
Copy link
Collaborator

Simon-Laux commented Mar 4, 2023

some points we need to have (feel free to edit to add more todo points):

Basics

  • files with TS need to be called .tsx if they contain jsx tags (html tags in js)
  • tsconfig should have the following compiler options:
// if you have an any type you need to write it out
"noImplicitAny": true,
 // makes us handle null and undefined cases, without it ts will only be half as useful
"strictNullChecks": true,
"strict": true

for more compiler options see https://www.typescriptlang.org/tsconfig#compilerOptions

Testing

  • add yarn script in package json that calls tsc --noEmit (real typescript compiler) to test for type errors, might be that parcel uses some faster way to translate typescript that doesn't do all checks.
  • add this to the testing CI

@farooqkz
Copy link
Owner Author

@farooqkz
Copy link
Owner Author

Related: infernojs/inferno#1619

@farooqkz
Copy link
Owner Author

Part of it has been done. Commits to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants