wxiaoguang
c2ebe3724f
refactor: introduce trString for frontend ( #38741 )
...
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: delvh <dev.lh@web.de >
2026-08-03 04:40:02 +00:00
Lunny Xiao
4e4ea75fb9
refactor(diff): drive diff DOM init from the global selector observer ( #38740 )
...
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2026-08-02 13:19:57 +00:00
silverwind
ae0bc0222a
Update to eslint 10 ( #36925 )
...
- Enable a few more rules, fix issues. The 2 `value` issues are
false-positives.
- Add exact types for `window.pageData` and
`window.notificationSettings`.
- peerDependencyRules for eslint-plugin-github unrestricted, the plugin
works in v10, but does not declare compatibility, pending
https://github.com/github/eslint-plugin-github/issues/680 .
- Added
[eslint-plugin-de-morgan](https://github.com/azat-io/eslint-plugin-de-morgan ),
no violations.
---------
Signed-off-by: silverwind <me@silverwind.io >
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2026-03-23 07:49:25 +00:00
silverwind
a52617b816
Clean up refreshViewedFilesSummary ( #36868 )
...
1. Use `textContent` instead of `innerHTML` to fix
https://github.com/go-gitea/gitea/security/code-scanning/170 .
2. Clean up surrounding code to remove unnecessary `if` checks on
elements that are guaranteed to exist.
---------
Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2026-03-08 20:49:07 +00:00
silverwind
42d294941c
Replace CSRF cookie with CrossOriginProtection ( #36183 )
...
Removes the CSRF cookie in favor of
[`CrossOriginProtection`](https://pkg.go.dev/net/http#CrossOriginProtection )
which relies purely on HTTP headers.
Fixes: https://github.com/go-gitea/gitea/issues/11188
Fixes: https://github.com/go-gitea/gitea/issues/30333
Helps: https://github.com/go-gitea/gitea/issues/35107
TODOs:
- [x] Fix tests
- [ ] Ideally add tests to validates the protection
---------
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-12-25 12:33:34 +02:00
silverwind
46d7adefe0
Enable TypeScript strictNullChecks ( #35843 )
...
A big step towards enabling strict mode in Typescript.
There was definitely a good share of potential bugs while refactoring
this. When in doubt, I opted to keep the potentially broken behaviour.
Notably, the `DOMEvent` type is gone, it was broken and we're better of
with type assertions on `e.target`.
---------
Signed-off-by: silverwind <me@silverwind.io >
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-12-03 02:13:16 +00:00
Lunny Xiao
206f4c88b1
Remove wrong code ( #35846 )
...
Follow #35821
Fix https://github.com/go-gitea/gitea/pull/35844#issuecomment-3483521045
The reviewed file numbers and progress have been set from backend so
that we don't need to update the numbers when clicking `load more`.
2025-11-04 17:46:17 +00:00
Kerwin Bryant
2b99a58f54
Mark parent directory as viewed when all files are viewed ( #33958 )
...
Fix #25644
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-04-15 22:35:22 +08:00
silverwind
c7f4ca2653
Enable Typescript noImplicitAny ( #33322 )
...
Enable `noImplicitAny` and fix all issues.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-01-22 15:11:51 +08:00
silverwind
4b21a6c792
Enable Typescript noImplicitThis ( #33250 )
...
- Enable https://www.typescriptlang.org/tsconfig/#noImplicitThis
- Wrap Vue Template-Syntax SFCs in
[`defineComponent`](https://vuejs.org/api/general#definecomponent ) which
makes type inference and linter work better
- Move `createApp` calls outside the SFCs into separate files
- Use [`PropType`](https://vuejs.org/api/utility-types#proptype-t ) where
appropriate
- Some top-level component properties changed order as dictated by the
linter
- Fix all tsc and lint issues that popped up during these refactors
2025-01-16 04:26:17 +08:00
silverwind
c8ea41b049
Fix remaining typescript issues, enable tsc ( #32840 )
...
Fixes 79 typescript errors. Discovered at least two bugs in
`notifications.ts`, and I'm pretty sure this feature was at least
partially broken and may still be, I don't really know how to test it.
After this, only like ~10 typescript errors remain in the codebase but
those are harder to solve.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2024-12-16 05:02:32 +08:00
silverwind
5791a73e75
Convert frontend code to typescript ( #31559 )
...
None of the frontend js/ts files was touched besides these two commands
(edit: no longer true, I touched one file in
https://github.com/go-gitea/gitea/pull/31559/commits/61105d0618e285d97e95044bfb64415f364a4526
because of a deprecation that was not showing before the rename).
`tsc` currently reports 778 errors, so I have disabled it in CI as
planned.
Everything appears to work fine.
2024-07-07 15:32:30 +00:00