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

Enable strictNullChecks for frontend and plugins #2911

Open
sniok opened this issue Feb 17, 2025 · 3 comments · May be fixed by #2919
Open

Enable strictNullChecks for frontend and plugins #2911

sniok opened this issue Feb 17, 2025 · 3 comments · May be fixed by #2919
Labels
frontend Issues related to the frontend plugins

Comments

@sniok
Copy link
Contributor

sniok commented Feb 17, 2025

We should enable typescript strictNullChecks option to reduce number of issues that can be avoidable. Especially since we have a pretty good type coverage

Example bug that could have been avoided with strict null checks headlamp-k8s/plugins#151

This would also require us to fix all the existing issues surfaced by this option, so I expect a pretty big refactor to enable this
For plugins this will have to be opt-in

@dosubot dosubot bot added frontend Issues related to the frontend plugins labels Feb 17, 2025
@DhairyaMajmudar
Copy link
Contributor

This fix would be helpful in reducing the bugs. Would love to help in this refactor 🤝🏻

@DhairyaMajmudar DhairyaMajmudar linked a pull request Feb 18, 2025 that will close this issue
@Jineshbansal
Copy link

@sniok To resolve this issue, do I just need to add "strictNullChecks": true in the tsconfig.json file in the frontend directory and then fix any issues that come up during npm run build? Am I correct?

@sniok
Copy link
Contributor Author

sniok commented Feb 21, 2025

@Jineshbansal yeah, basically
enable strictNullChecks, then run npm run tsc. I'm expecting a lot of errors there so to keep it manageable we should fix only some of them at a time (per pull request) and then turn strictNullChecks off. Once all of them are fixed we can enable strictNullChecks for real to prevent any new issues from being added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Issues related to the frontend plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants