mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-21 18:24:58 +08:00
Add knip linter (#36442)
This adds [knip](https://github.com/webpro-nl/knip), a tool to find unused files, dependencies and exports in JS. Fixed all discovered issues. 1. knip apparently has some issue resolving imports from `d.ts` to `.ts` so I worked around it by moving the two affected types to where they are used. 2. I don't know why `modules/fomantic/dropdown.ts` had a new typescript error, but I fixed it. 3. Use named export for `EsbuildPlugin`, I think this was added recently.
This commit is contained in:
21
web_src/js/globals.d.ts
vendored
21
web_src/js/globals.d.ts
vendored
@@ -49,7 +49,26 @@ interface Element {
|
||||
}
|
||||
|
||||
interface Window {
|
||||
config: import('./web_src/js/types.ts').Config;
|
||||
config: {
|
||||
appUrl: string,
|
||||
appSubUrl: string,
|
||||
assetVersionEncoded: string,
|
||||
assetUrlPrefix: string,
|
||||
runModeIsProd: boolean,
|
||||
customEmojis: Record<string, string>,
|
||||
pageData: Record<string, any>,
|
||||
notificationSettings: Record<string, any>,
|
||||
enableTimeTracking: boolean,
|
||||
mentionValues: Array<{
|
||||
key: string,
|
||||
value: string,
|
||||
name: string,
|
||||
fullname: string,
|
||||
avatar: string,
|
||||
}>,
|
||||
mermaidMaxSourceCharacters: number,
|
||||
i18n: Record<string, string>,
|
||||
},
|
||||
$: typeof import('@types/jquery'),
|
||||
jQuery: typeof import('@types/jquery'),
|
||||
htmx: typeof import('htmx.org').default,
|
||||
|
||||
Reference in New Issue
Block a user