-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Could you reconsider the "tsconfig.json" default value of "strict: false"? #12895
Comments
I have personally experienced the pain of trying to migrate a huge project from |
User assumption is not the responsibility of the framework, I supposed. Note typescript is not perfect, the trans-piled code sometimes can cause unexpected behavior, too. I think the default should stay as false. User can change to true anytime as they see fit. Or better, checkout https://github.com/facebook/prop-types |
A question could potentially be added as part of #8128. |
We're going to leave this default as |
hey team, love the work. since a flag |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
I just noticed that next.js defaults to
strict: false
in the generatedtsconfig.json
.The reasoning behind seems to be (quoting @Timer from ##7716):
I would ask you if it were possible to reconsider this.
Running
tsc --init
creates atsconfig.json
withstrict: true
since that option was introduced with TypeScript 2.3.An advanced user will probably not notice this for quite some time, because they assume that TypeScript offers it's full (default-configuration) functionality out of the box, just wondering about unsound behaviour here and there until it piles up and finally going to
strict: true
has actually become a chore.If there are any strict options that are not working well with next.js, it's still an option, to default to
strict: true
in combination withstrictThatHurts: false
and mentioning to that in the documentation.I have to admit that I'm not even a next.js user myself (athough it is in my list of stuff to check out!), but got a report by a user of our library (@reduxjs/toolkit) about strange behaviour - which we could attribute back to
strictNullChecks
being disabled. The user was quite irritated because they had assumed thatstrict
would be enabled.So I don't really believe that you're doing your users a service with this default :(
As an alternative, if you could not commit to a
strict: true
default, maybe it might be an option to actively ask the user for feedback on it when thetsconfig.json
would be filled with the default values - and let the user decide between "loose" and "strict" behaviour?The text was updated successfully, but these errors were encountered: