workspace: add oxlint

This commit is contained in:
undefined committed 2025-03-10 16:16:34 +08:00
1 parent b48e70019a
commit cda3a8f855
18 files changed
+120 -44

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ export function createRegistry(ctx: Context) {
function createMetric<Q extends string, T extends (new (a: any) => Metric<Q>)>(
C: T, name: string, help: string, extra?: T extends new (a: infer R) => any ? Partial<R> : never,
): T extends (new (a) => Gauge<Q>) ? Gauge<Q> : T extends (new (a) => Counter<Q>) ? Counter<Q> : Metric<Q> {
const metric = new C({ name, help, ...(extra || {}) });
const metric = new C({ name, help, ...extra });
registry.registerMetric(metric);
return metric as any;
}