Skip to content

client: More React/TypeScript fixes#1544

Merged
jtojnar merged 12 commits intomasterfrom
react-improvements
Dec 24, 2025
Merged

client: More React/TypeScript fixes#1544
jtojnar merged 12 commits intomasterfrom
react-improvements

Conversation

@jtojnar
Copy link
Member

@jtojnar jtojnar commented Dec 24, 2025

Reduce globals, fix errors and enable noImplicitAny TypeScript option.

Follow-up to #1543

@netlify
Copy link

netlify bot commented Dec 24, 2025

Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit 7564df0
🔍 Latest deploy log https://app.netlify.com/projects/selfoss/deploys/694bcb405024c60008264e4c

@jtojnar jtojnar added enhancement javascript Pull requests that update Javascript code labels Dec 24, 2025
@jtojnar jtojnar added this to the 2.20 milestone Dec 24, 2025
`RequestInit` and `HeadersInit` contain more fields that we might want.
Allows us to slightly simplify the `MessageFormat` code, while making the translations clearer. We already assume that in types.

We already started with it in 6d268e3 but due to insufficient typing, we missed a few spots.
We were already doing that, just did not notice the wrong type annotation previously.
- Accept numbers for param values.
- Add type annotations.
- Use strict equality.
Stops TypeScript compiler complaining with `noImplicitAny` and ensures that we cannot use incorrect message key.
No need to repeat the checks on every call of `_`.
Ensures that compiler knows what we intend.
Reduces the number of errors reported by TypeScript compiler in strict mode from 398 to 294.
@jtojnar jtojnar merged commit 7564df0 into master Dec 24, 2025
14 checks passed
@jtojnar jtojnar deleted the react-improvements branch December 24, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant