Remove and forbid @ts-expect-error (#36513)
Removes `@ts-expect-error` in the code base and forbids it. --------- Signed-off-by: wxiaoguang <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: silverwind <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+[email protected]>
silverwind
silverwind
wxiaoguang
parent
c2dea22926
commit
7883f6dde9
@@ -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