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

Add types for js globals #31586

Merged
merged 5 commits into from
Jul 11, 2024
Merged

Add types for js globals #31586

merged 5 commits into from
Jul 11, 2024

Conversation

silverwind
Copy link
Member

Adds types for window.config and jQuery/htmx globals, eliminating 48 tsc errors.

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 7, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 7, 2024
@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 Jul 8, 2024
@silverwind
Copy link
Member Author

silverwind commented Jul 9, 2024

Some additional fixes for htmx added, by using window, we can avoid having to declare the eslint global and this also makes typescript happy.

htmx is currently not shipping types so it resolves to any, but as soon as they do, these types will start working.

@6543
Copy link
Member

6543 commented Jul 10, 2024

We still have jquery?!?

@silverwind
Copy link
Member Author

Yes, fomantic ui depends on it and a bit of first party code uses it too, which has to be refactored. We don't use that global in first party code, we always import it explicitly.

@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 Jul 11, 2024
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 11, 2024
@silverwind silverwind enabled auto-merge (squash) July 11, 2024 10:15
@silverwind silverwind merged commit 228c354 into go-gitea:main Jul 11, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Jul 11, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 11, 2024
@silverwind silverwind deleted the typeglobal branch July 11, 2024 10:46
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 12, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Display app name in the registration email title (go-gitea#31562)
  typo on date in security document (go-gitea#31617)
  Update JS dependencies (go-gitea#31616)
  Add types for js globals (go-gitea#31586)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/internal size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants