Skip to content

Strict null-checks #597

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

Merged
merged 8 commits into from
Nov 2, 2022
Merged

Strict null-checks #597

merged 8 commits into from
Nov 2, 2022

Conversation

olemartinorg
Copy link
Contributor

Description

This PR enables strict null-checks in TypeScript, and makes sure all (currently) nullable values are properly checked. There should probably be some more nullable values, since the entire codebase has been written without strict null checks (so nullability was implicit everywhere until now). This is messy and suboptimal in many ways, but it's a step in the right direction where future changes are now much less likely to throw unexpected errors on values that are null/undefined.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • [ ] Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • [ ] User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 1, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 9 Code Smells

62.7% 62.7% Coverage
0.0% 0.0% Duplication

Copy link
Member

@bjosttveit bjosttveit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olemartinorg olemartinorg merged commit b23f80b into main Nov 2, 2022
@olemartinorg olemartinorg deleted the chore/null-checks branch November 2, 2022 09:33
@olemartinorg olemartinorg added kind/bug Something isn't working and removed kind/bug Something isn't working labels Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Technical debt: Enable null-checks in TypeScript
3 participants