Conversation
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
@ts-expect-error suppressions from web_src/js
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Ok everything is addressed. |
There was a problem hiding this comment.
Pull request overview
This pull request removes all instances of @ts-expect-error comments from the TypeScript codebase and adds an ESLint rule to forbid their future use. The changes involve replacing @ts-expect-error with proper type assertions (using as unknown as), adding type declarations for third-party modules without types, and making minor adjustments to handle TypeScript type issues.
Changes:
- Enabled ESLint rule to forbid
@ts-expect-errorand addedwebworkerlib to TypeScript configuration - Added comprehensive type declarations for external modules (asciinema-player, citation-js, vue-bar-graph, mcaptcha) in
types.d.ts - Replaced all
@ts-expect-errorcomments with proper type assertions usingas unknown aspattern or fixed underlying type issues
Reviewed changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| eslint.config.ts | Enabled ban on @ts-expect-error and fixed type assertions for plugin imports |
| tsconfig.json | Added webworker lib for SharedWorkerGlobalScope support |
| types.d.ts | Added type declarations for external modules previously suppressed with @ts-expect-error |
| web_src/js/globals.d.ts | Moved module declarations to types.d.ts and added MessageEvent.ports interface extension |
| web_src/js/webcomponents/polyfills.ts | Added type assertions for incomplete Intl.NumberFormat polyfill |
| web_src/js/modules/sortable.ts | Changed parameter type to HTMLElement and added type assertion for import |
| web_src/js/markup/asciicast.ts | Added non-null assertion for required attribute |
| web_src/js/features/tribute.ts | Added type imports and assertions, changed noMatchTemplate to function |
| web_src/js/features/repo-settings-branches.ts | Added type assertion for querySelector result |
| web_src/js/features/repo-settings-branches.test.ts | Changed type assertion from as to as unknown as |
| web_src/js/features/repo-projects.ts | Added type assertions for querySelector results |
| web_src/js/features/repo-issue-list.ts | Added type assertion for querySelector result |
| web_src/js/features/repo-diff.ts | Replaced @ts-expect-error with as any for form nullification |
| web_src/js/features/eventsource.sharedworker.ts | Added SharedWorkerGlobalScope cast and fallback for MessageEvent.ports |
| web_src/js/features/citation.ts | Removed @ts-expect-error comments for imports (types now in types.d.ts) |
| web_src/js/features/captcha.ts | Removed comment, allows mutation via type declaration |
| web_src/js/components/*.vue | Added custom type definitions and replaced type suppressions with proper assertions |
| web_src/js/bootstrap.ts | Added type assertion for error handler array iteration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Did some more refactors on tribute types. Not entirely clean but better than before. Still working fine for emoji and mentions. |
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Removes `@ts-expect-error` in the code base and forbids it. --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* giteaofficial/main: (26 commits) [skip ci] Updated translations via Crowdin Remove and forbid `@ts-expect-error` (go-gitea#36513) Add resolve/unresolve review comment API endpoints (go-gitea#36441) Fix incorrect vendored detections (go-gitea#36508) Bump alpine to 3.23, add platforms to `docker-dryrun` (go-gitea#36379) Unify repo names in system notices (go-gitea#36491) Allow scroll propagation outside code editor (go-gitea#36502) Refactor ActionsTaskID (go-gitea#36503) Update JS deps, remove `knip`, misc tweaks (go-gitea#36499) [skip ci] Updated translations via Crowdin Fix editorconfig not respected in PR Conversation view (go-gitea#36492) Add FOLDER_ICON_THEME configuration option (go-gitea#36496) Don't create self-references in merged PRs (go-gitea#36490) Use reserved .test TLD for unit tests (go-gitea#36498) Fix bug when list pull request commits (go-gitea#36485) Update some go dependencies (go-gitea#36489) chore: add comments for "api/healthz", clean up test env (go-gitea#36481) [SECURITY] Toolchain Update to Go 1.25.6 (go-gitea#36480) [skip ci] Updated translations via Crowdin Render merged pull request title as such in dashboard feed (go-gitea#36479) ...
* origin/main: (1246 commits) fix(packages/container): data race when uploading container blobs concurrently (go-gitea#36524) [skip ci] Updated translations via Crowdin Remove and forbid `@ts-expect-error` (go-gitea#36513) Add resolve/unresolve review comment API endpoints (go-gitea#36441) Fix incorrect vendored detections (go-gitea#36508) Bump alpine to 3.23, add platforms to `docker-dryrun` (go-gitea#36379) Unify repo names in system notices (go-gitea#36491) Allow scroll propagation outside code editor (go-gitea#36502) Refactor ActionsTaskID (go-gitea#36503) Update JS deps, remove `knip`, misc tweaks (go-gitea#36499) [skip ci] Updated translations via Crowdin Fix editorconfig not respected in PR Conversation view (go-gitea#36492) Add FOLDER_ICON_THEME configuration option (go-gitea#36496) Don't create self-references in merged PRs (go-gitea#36490) Use reserved .test TLD for unit tests (go-gitea#36498) Fix bug when list pull request commits (go-gitea#36485) Update some go dependencies (go-gitea#36489) chore: add comments for "api/healthz", clean up test env (go-gitea#36481) [SECURITY] Toolchain Update to Go 1.25.6 (go-gitea#36480) [skip ci] Updated translations via Crowdin ... # Conflicts: # modules/templates/helper.go # options/locale/locale_en-US.ini # routers/web/repo/cherry_pick.go # routers/web/repo/editor.go # routers/web/repo/patch.go # templates/repo/editor/edit.tmpl # web_src/js/features/codeeditor.ts
Removes
@ts-expect-errorin the code base and forbids it.