From 92e04a651fef462806801b4c760b8dee315e56f3 Mon Sep 17 00:00:00 2001 From: Yugang Cao <34439652+Talljack@users.noreply.github.com> Date: Fri, 21 Jan 2022 14:56:20 +0800 Subject: [PATCH] chore: type improvements (#5264) --- packages/runtime-core/src/profiling.ts | 5 ++--- packages/runtime-test/src/nodeOps.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/profiling.ts b/packages/runtime-core/src/profiling.ts index 8125c2f6993..b2616947821 100644 --- a/packages/runtime-core/src/profiling.ts +++ b/packages/runtime-core/src/profiling.ts @@ -1,8 +1,9 @@ +/* eslint-disable no-restricted-globals */ import { ComponentInternalInstance, formatComponentName } from './component' import { devtoolsPerfEnd, devtoolsPerfStart } from './devtools' let supported: boolean -let perf: any +let perf: Performance export function startMeasure( instance: ComponentInternalInstance, @@ -40,13 +41,11 @@ function isSupported() { if (supported !== undefined) { return supported } - /* eslint-disable no-restricted-globals */ if (typeof window !== 'undefined' && window.performance) { supported = true perf = window.performance } else { supported = false } - /* eslint-enable no-restricted-globals */ return supported } diff --git a/packages/runtime-test/src/nodeOps.ts b/packages/runtime-test/src/nodeOps.ts index d844176a59f..94a793cc483 100644 --- a/packages/runtime-test/src/nodeOps.ts +++ b/packages/runtime-test/src/nodeOps.ts @@ -224,7 +224,7 @@ function nextSibling(node: TestNode): TestNode | null { return parent.children[i + 1] || null } -function querySelector(): any { +function querySelector(): never { throw new Error('querySelector not supported in test renderer.') }