-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
Improving the overall type safety of the entire library #2917
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,11 +17,7 @@ | |
"declaration": true, | ||
"downlevelIteration": true, | ||
|
||
"suppressImplicitAnyIndexErrors": true, | ||
"noImplicitAny": true, | ||
"alwaysStrict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"strict": true, | ||
"skipLibCheck": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if running type check for dependencies is a good idea. This might be overhead for our build process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was an oversight by me. Thank you for spotting it. |
||
|
||
"paths": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I avoided to use ts-jest on purpose in order to have faster compilation and reduce overhead of tsc. I don't think we need type checking in tests. At least, it is not CI's job I believe. So it's done by babel already. I thought of removing ts-jest completely but I realized that we still need it for
pathsToModuleNameMapper
above to usepaths
fromtsconfig
file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree that for most cases the CI should not have to run type checking. But for open source tools and libraries with advanced generic types like the
ResolversComposerMapping
type, they should absolutely be tested . They are still a written piece of code and should be treated as such since they are prone to errors like any other code.Tsc and babel only validate that types are correct. They don't know how to test intended behavior within generic types and ultimately allows code like this to pass type checking
I understand that faster compile times and less overhead is desired. But if it compromises type robustness then it's not a great trade-off and makes using said types superfluous since they might or might not work as intended.