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

Switch to strictNullChecks: true for new projects #14080

Open
1 task done
dmint789 opened this issue Oct 20, 2024 · 1 comment
Open
1 task done

Switch to strictNullChecks: true for new projects #14080

dmint789 opened this issue Oct 20, 2024 · 1 comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@dmint789
Copy link

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

I have realized that Nest JS sets up projects with strictNullChecks: false in the tsconfig.json by default. I was a bit of a beginner in web development when I first started using Nest JS, but I now see that this is not a good setting to use, because it leads to many bugs being missed. Now I have to migrate quite a big code base to strictNullChecks: true, which will cost me a lot of time.

Describe the solution you'd like

This option should not be set in new Nest JS projects (meaning Typescript will treat it as true, since Nest JS sets strict: true for new projects).

Teachability, documentation, adoption, migration strategy

This doesn't require developers having to relearn anything, because it would only apply to new Nest JS projects.

What is the motivation / use case for changing the behavior?

This will prevent developers from having to migrate their code bases if they decided to change this setting in the future. If they wanted to set it to false, they could do so without having to change anything in the code, because that would be more permissive.

@dmint789 dmint789 added needs triage This issue has not been looked into type: enhancement 🐺 labels Oct 20, 2024
@micalevisk
Copy link
Member

Isn't --strict flag on nest new + a mention in the docs enough?

I like the strict mode tho. And at work we had the exact same problem of yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

2 participants