Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cannot find name 'Node' error in types/visitor.d.ts #2107

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

r7kamura
Copy link
Contributor

@r7kamura r7kamura commented Dec 22, 2023

When I tried to use npm's @ruby/prism package in my TypeScript project, I encountered the following error in tsc:

$ npm run compile

> [email protected] compile
> npm run compile:tsc


> [email protected] compile:tsc
> tsc -b

server/node_modules/@ruby/prism/types/visitor.d.ts:15:17 - error TS2304: Cannot find name 'Node'.

15     visit(node: Node): void;
                   ~~~~

server/node_modules/@ruby/prism/types/visitor.d.ts:27:27 - error TS2304: Cannot find name 'Node'.

27     visitChildNodes(node: Node): void;
                             ~~~~


Found 2 errors.

After a little investigation, it appears that some type names described in jsdoc are incorrect. I changed this part locally from Node to nodes.Node and confirmed that this tsc compilation passes.

@kddnewton kddnewton merged commit 1f0aa14 into ruby:main Jan 2, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants