Skip to content

Commit 903b464

Browse files
authored
chore: remove acorn-walk ambient type definitions (#4391)
1 parent efd71e9 commit 903b464

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/utils/pureComments.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as acorn from 'acorn';
2-
import { type BaseWalker, base as basicWalker } from 'acorn-walk';
2+
import { base as basicWalker } from 'acorn-walk';
33
import {
44
BinaryExpression,
55
CallExpression,
@@ -29,7 +29,7 @@ interface NodeWithComments extends acorn.Node {
2929
function handlePureAnnotationsOfNode(
3030
node: acorn.Node,
3131
state: CommentState,
32-
type: string = node.type
32+
type = node.type
3333
): void {
3434
const { annotations } = state;
3535
let comment = annotations[state.annotationIndex];
@@ -38,7 +38,7 @@ function handlePureAnnotationsOfNode(
3838
comment = annotations[++state.annotationIndex];
3939
}
4040
if (comment && comment.end <= node.end) {
41-
(basicWalker as BaseWalker<CommentState>)[type](node, state, handlePureAnnotationsOfNode);
41+
basicWalker[type](node, state, handlePureAnnotationsOfNode);
4242
while ((comment = annotations[state.annotationIndex]) && comment.end <= node.end) {
4343
++state.annotationIndex;
4444
annotateNode(node, comment, false);

typings/declarations.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@ declare module 'rollup-plugin-string' {
99
export const string: import('rollup').PluginImpl;
1010
}
1111

12-
declare module 'acorn-walk' {
13-
type WalkerCallback<TState> = (node: acorn.Node, state: TState) => void;
14-
type RecursiveWalkerFn<TState> = (
15-
node: acorn.Node,
16-
state: TState,
17-
callback: WalkerCallback<TState>
18-
) => void;
19-
export type BaseWalker<TState> = Record<string, RecursiveWalkerFn<TState>>;
20-
export const base: BaseWalker<unknown>;
21-
}
22-
2312
declare module 'is-reference' {
2413
export default function is_reference(
2514
node: NodeWithFieldDefinition,

0 commit comments

Comments
 (0)