mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-01 20:59:45 +09:00
chore: update eslint, enable more rules and fix their findings (#39438)
Update eslint and its plugins, enable more rules and fix their findings: 1. `unicorn/no-unsafe-string-replacement` found that uploading a file whose name contains `$&` inserted a broken markdown link, because `String#replace` expands such patterns in the replacement string 2. `@typescript-eslint/require-await` removes `async` from functions that never await 3. Plugin rules not covered by a preset are now listed explicitly --------- Co-authored-by: bircni <bircni@icloud.com>
This commit is contained in:
@@ -68,7 +68,7 @@ function toggleLoadingIndicator(el: HTMLElement, opt: FetchActionOpts, isLoading
|
||||
}
|
||||
}
|
||||
|
||||
export async function handleFetchActionSuccessJson(el: HTMLElement, respJson: {redirect?: unknown} | null) {
|
||||
export function handleFetchActionSuccessJson(el: HTMLElement, respJson: {redirect?: unknown} | null) {
|
||||
ignoreAreYouSure(el); // ignore the areYouSure check before reloading
|
||||
const redirect = respJson?.redirect;
|
||||
if (typeof redirect === 'string' && redirect) {
|
||||
@@ -84,7 +84,7 @@ async function handleFetchActionSuccess(el: HTMLElement, opt: FetchActionOpts, r
|
||||
const respText = await resp.text();
|
||||
const respJson = isRespJson ? JSON.parse(respText) : null;
|
||||
if (isRespJson) {
|
||||
await handleFetchActionSuccessJson(el, respJson);
|
||||
handleFetchActionSuccessJson(el, respJson);
|
||||
} else if (opt.successSync) {
|
||||
await handleFetchActionSuccessSync(el, opt.successSync, respText);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user