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

Enforce TS strict type checking. #23601

Merged
merged 27 commits into from
Sep 7, 2024
Merged

Enforce TS strict type checking. #23601

merged 27 commits into from
Sep 7, 2024

Conversation

Nerivec
Copy link
Collaborator

@Nerivec Nerivec commented Aug 13, 2024

Require ZH: Koenkk/zigbee-herdsman#1146
Require ZHC: TODO

@Koenkk I'll let you check the HA extension, don't know much about what it's expecting on the other other side, so, didn't touch it much.
Settings are a bit nasty too. Seems there a need for a SettingsWithDefaults type or something similar, to avoid the many xyz | undefined that result from current typing?
And have to confirm the logic in zigbee.ts for resolveDevice and resolveEntity.

@Nerivec
Copy link
Collaborator Author

Nerivec commented Aug 13, 2024

Note to self: all tests are passing locally in 4c7a5fa (ci fails because of build)

lib/util/settings.ts Outdated Show resolved Hide resolved
lib/extension/publish.ts Outdated Show resolved Hide resolved
lib/extension/publish.ts Outdated Show resolved Hide resolved
@Koenkk
Copy link
Owner

Koenkk commented Sep 1, 2024

CI passes now, @Nerivec let me know if this can be merged

@Koenkk Koenkk marked this pull request as ready for review September 3, 2024 19:02
@Nerivec
Copy link
Collaborator Author

Nerivec commented Sep 3, 2024

Should be good to go.
Some of the logic is a tiny bit different here and there, but we'll know if more coverage is needed from dev testers during the month.

I think an extra manual check is warranted in z2m, zhc, zh and frontend on the following:

  • === undefined
  • !== undefined
  • === null
  • !== null

Since a few occurrences changed from null to undefined, it could create weird behaviors (especially since a lot of stuff gets processed into js<>json). zhc and frontend definitely need "extra-extra-checking" on this since they don't have strict: true yet.

@Koenkk
Copy link
Owner

Koenkk commented Sep 4, 2024

Great, I will hold it back for a couple of days, need to make a hotfix release.

@Koenkk Koenkk enabled auto-merge (squash) September 7, 2024 11:39
@Koenkk Koenkk merged commit 48d77e4 into Koenkk:dev Sep 7, 2024
11 checks passed
@Nerivec Nerivec deleted the ts-strict branch October 4, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants