From 903b4642fb0c08ef0eb21dfdaba7f80b639e80f2 Mon Sep 17 00:00:00 2001 From: dnalborczyk Date: Wed, 9 Feb 2022 00:59:44 -0500 Subject: [PATCH] chore: remove acorn-walk ambient type definitions (#4391) --- src/utils/pureComments.ts | 6 +++--- typings/declarations.d.ts | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/utils/pureComments.ts b/src/utils/pureComments.ts index dc385a284fa..0d7403dae25 100644 --- a/src/utils/pureComments.ts +++ b/src/utils/pureComments.ts @@ -1,5 +1,5 @@ import * as acorn from 'acorn'; -import { type BaseWalker, base as basicWalker } from 'acorn-walk'; +import { base as basicWalker } from 'acorn-walk'; import { BinaryExpression, CallExpression, @@ -29,7 +29,7 @@ interface NodeWithComments extends acorn.Node { function handlePureAnnotationsOfNode( node: acorn.Node, state: CommentState, - type: string = node.type + type = node.type ): void { const { annotations } = state; let comment = annotations[state.annotationIndex]; @@ -38,7 +38,7 @@ function handlePureAnnotationsOfNode( comment = annotations[++state.annotationIndex]; } if (comment && comment.end <= node.end) { - (basicWalker as BaseWalker)[type](node, state, handlePureAnnotationsOfNode); + basicWalker[type](node, state, handlePureAnnotationsOfNode); while ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) { ++state.annotationIndex; annotateNode(node, comment, false); diff --git a/typings/declarations.d.ts b/typings/declarations.d.ts index d4b36e82f62..5e7f0ff8f21 100644 --- a/typings/declarations.d.ts +++ b/typings/declarations.d.ts @@ -9,17 +9,6 @@ declare module 'rollup-plugin-string' { export const string: import('rollup').PluginImpl; } -declare module 'acorn-walk' { - type WalkerCallback = (node: acorn.Node, state: TState) => void; - type RecursiveWalkerFn = ( - node: acorn.Node, - state: TState, - callback: WalkerCallback - ) => void; - export type BaseWalker = Record>; - export const base: BaseWalker; -} - declare module 'is-reference' { export default function is_reference( node: NodeWithFieldDefinition,