mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-19 16:20:33 +01:00
Remove and forbid @ts-expect-error (#36513)
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>
This commit is contained in:
@@ -4,17 +4,16 @@ try {
|
||||
new Intl.NumberFormat('en', {style: 'unit', unit: 'minute'}).format(1);
|
||||
} catch {
|
||||
const intlNumberFormat = Intl.NumberFormat;
|
||||
// @ts-expect-error - polyfill is incomplete
|
||||
Intl.NumberFormat = function(locales: string | string[], options: Intl.NumberFormatOptions) {
|
||||
if (options.style === 'unit') {
|
||||
return {
|
||||
format(value: number | bigint | string) {
|
||||
return ` ${value} ${options.unit}`;
|
||||
},
|
||||
};
|
||||
} as Intl.NumberFormat;
|
||||
}
|
||||
return intlNumberFormat(locales, options);
|
||||
};
|
||||
} as unknown as typeof Intl.NumberFormat;
|
||||
}
|
||||
|
||||
export function weakRefClass() {
|
||||
|
||||
Reference in New Issue
Block a user