Skip to content

Conversation

@silverwind
Copy link
Member

@silverwind silverwind commented Oct 30, 2025

In preparation to work on enabling https://www.typescriptlang.org/tsconfig/#strictNullChecks, I fixed all the issues outside of web_src that came up when the option was enabled. There was also one lint issue in web_src that apparently only came up with the option enabled, so I fixed that as well.

isTruthy is introduced because Typescript has a bug regarding filter(Boolean) which they are seemingly unwilling to fix.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 30, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Oct 30, 2025
@silverwind
Copy link
Member Author

Regarding this isTruthy, I'm still looking for a better way. Typescript and the unicorn rule are in conflict regarding it, so it's kind of tricky.

@silverwind
Copy link
Member Author

silverwind commented Oct 31, 2025

Found a better way, Boolean as any works and the resulting type is Array<string>. Strictly speaking https://stackoverflow.com/a/47636222/808699 would be better but I don't feel like doing such type gymnastics.

Edit: as per this, the resulting type was not correct, so I used the longer form.

Signed-off-by: silverwind <[email protected]>
@silverwind
Copy link
Member Author

Diff is now minimal, I reverted a few unnecessary things.

@silverwind silverwind added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Nov 3, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 3, 2025
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Nov 3, 2025
@silverwind silverwind enabled auto-merge (squash) November 3, 2025 20:07
@silverwind silverwind merged commit 37208fe into go-gitea:main Nov 3, 2025
25 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Nov 3, 2025
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants