From 330e9966cf2e603ca41234af96c99a82aeaa0afb Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 15 Aug 2022 15:33:37 +0200 Subject: [PATCH] fix typecheck --- packages/vite/src/plugins/composable-keys.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vite/src/plugins/composable-keys.ts b/packages/vite/src/plugins/composable-keys.ts index 6fc5d4a4189..4b365ee473b 100644 --- a/packages/vite/src/plugins/composable-keys.ts +++ b/packages/vite/src/plugins/composable-keys.ts @@ -34,10 +34,10 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio sourceType: 'module', ecmaVersion: 'latest' }), { - // @ts-expect-error type cast - enter (node: CallExpression) { - if (node.type !== 'CallExpression' || node.callee.type !== 'Identifier') { return } - if (keyedFunctions.includes(node.callee.name) && node.arguments.length < 4) { + enter (_node) { + if (_node.type !== 'CallExpression' || (_node as CallExpression).callee.type !== 'Identifier') { return } + const node: CallExpression = _node as CallExpression + if (keyedFunctions.includes((node.callee as any).name) && node.arguments.length < 4) { const end = (node as any).end s.appendLeft( codeIndex + end - 1,