diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-06-25 00:00:31 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-09 17:13:30 +0200 |
commit | 691f570237e26398aa22f40c0efca23141d5583e (patch) | |
tree | 4409270ac8ee482ad03f745f77003c726ffbf09f /apps/systemtags | |
parent | 3a97dbf248b3e581b5782a638743958eb6f2a640 (diff) | |
download | nextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.tar.gz nextcloud-server-691f570237e26398aa22f40c0efca23141d5583e.zip |
chore: Enable ESLint for apps and fix all errors
Nevertheless this causes a huge amount of new warnings.
Previously the shell script for directories to lint was wrong it was generating all app names to lint,
but was missing the `apps/` prefix. Causing only `core` to be linted.
Co-authored-by: Grigorii K. Shartsev <me@shgk.me>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/systemtags')
-rw-r--r-- | apps/systemtags/src/services/api.ts | 1 | ||||
-rw-r--r-- | apps/systemtags/src/services/davClient.ts | 12 | ||||
-rw-r--r-- | apps/systemtags/src/services/files.ts | 2 | ||||
-rw-r--r-- | apps/systemtags/src/utils.ts | 9 |
4 files changed, 14 insertions, 10 deletions
diff --git a/apps/systemtags/src/services/api.ts b/apps/systemtags/src/services/api.ts index f8d626f6720..64ca97fc02c 100644 --- a/apps/systemtags/src/services/api.ts +++ b/apps/systemtags/src/services/api.ts @@ -52,6 +52,7 @@ export const fetchLastUsedTagIds = async (): Promise<number[]> => { } /** + * @param tag * @return created tag id */ export const createTag = async (tag: Tag | ServerTag): Promise<number> => { diff --git a/apps/systemtags/src/services/davClient.ts b/apps/systemtags/src/services/davClient.ts index 505319f2970..9a5eeeecb55 100644 --- a/apps/systemtags/src/services/davClient.ts +++ b/apps/systemtags/src/services/davClient.ts @@ -13,12 +13,12 @@ export const davClient = createClient(rootUrl) // set CSRF token header const setHeaders = (token: string | null) => { - davClient.setHeaders({ - // Add this so the server knows it is an request from the browser - 'X-Requested-With': 'XMLHttpRequest', - // Inject user auth - requesttoken: token ?? '', - }) + davClient.setHeaders({ + // Add this so the server knows it is an request from the browser + 'X-Requested-With': 'XMLHttpRequest', + // Inject user auth + requesttoken: token ?? '', + }) } // refresh headers when request token changes diff --git a/apps/systemtags/src/services/files.ts b/apps/systemtags/src/services/files.ts index c645837715a..74917bf0415 100644 --- a/apps/systemtags/src/services/files.ts +++ b/apps/systemtags/src/services/files.ts @@ -27,6 +27,8 @@ export const fetchTagsForFile = async (fileId: number): Promise<TagWithId[]> => } /** + * @param tag + * @param fileId * @return created tag id */ export const createTagForFile = async (tag: Tag, fileId: number): Promise<number> => { diff --git a/apps/systemtags/src/utils.ts b/apps/systemtags/src/utils.ts index 41250cea695..c7e0dcbaa5b 100644 --- a/apps/systemtags/src/utils.ts +++ b/apps/systemtags/src/utils.ts @@ -45,12 +45,13 @@ export const parseIdFromLocation = (url: string): number => { } export const formatTag = (initialTag: Tag | ServerTag): ServerTag => { - const tag: any = { ...initialTag } - if (tag.name && !tag.displayName) { - return tag + if ('name' in initialTag && !('displayName' in initialTag)) { + return { ...initialTag } } + + const tag: Record<string, unknown> = { ...initialTag } tag.name = tag.displayName delete tag.displayName - return tag + return tag as unknown as ServerTag } |