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

Bug: Type error when importing @eslint/markdown from TypeScript file #313

Closed
1 task
danielrentz opened this issue Jan 16, 2025 · 9 comments · Fixed by #314
Closed
1 task

Bug: Type error when importing @eslint/markdown from TypeScript file #313

danielrentz opened this issue Jan 16, 2025 · 9 comments · Fixed by #314
Labels
accepted bug repro:yes Issues with a reproducible example

Comments

@danielrentz
Copy link
Contributor

danielrentz commented Jan 16, 2025

Environment

ESLint version: 9.18.0
@eslint/markdown version: 6.2.1
Node version: 20.18.1
npm version: 9.8.1
Operating System: Win11

Which language are you using?

commonmark

What did you do?

Import @eslint/markdown from a TypeScript file. Do not enable "skipLibChecks" in tsconfig.json.

What did you expect to happen?

No type error.

What actually happened?

../node_modules/@eslint/markdown/dist/esm/index.d.ts:25:52 - error TS2694: Namespace '"../node_modules/@eslint/core/dist/esm/types"' has no exported member 'SyntaxElement'.

25 export type SyntaxElement = import("@eslint/core").SyntaxElement;
                                                      ~~~~~~~~~~~~~

Found 1 error in ../node_modules/@eslint/markdown/dist/esm/index.d.ts:25

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-1rcyxw5v

npm i
npx tsc

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@danielrentz danielrentz added bug repro:needed This issue should include a reproducible example labels Jan 16, 2025
@eslintbot eslintbot added this to Triage Jan 16, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jan 16, 2025
@danielrentz danielrentz changed the title Bug: (fill in) Bug: Type error when importing @eslint/markdown from TypeScript file Jan 16, 2025
@fasttime fasttime moved this from Needs Triage to Triaging in Triage Jan 16, 2025
@fasttime
Copy link
Member

Thanks for the issue @danielrentz. Could you maybe create a repro for this problem, like a small GitHub repo or a StackBlitz project, to make sure everybody understands what is going on? It would be interesting to see at least your package.json and tsconfig.json in order to reproduce the error.

@danielrentz
Copy link
Contributor Author

@fasttime I have added stackblitz link and commands in description above.

@fasttime fasttime added repro:yes Issues with a reproducible example and removed repro:needed This issue should include a reproducible example labels Jan 16, 2025
@fasttime
Copy link
Member

Thanks! It looks like the error is being caused by a missing type SyntaxElement:

/** @typedef {import("@eslint/core").SyntaxElement} SyntaxElement */

Probably we could delete the whole line since the imported type is not used.

@fasttime fasttime moved this from Triaging to Ready to Implement in Triage Jan 16, 2025
@nzakas
Copy link
Member

nzakas commented Jan 16, 2025

That looks like a holdover from the previous @eslint/core version.

@nzakas
Copy link
Member

nzakas commented Jan 16, 2025

@danielrentz as this just involves removing one line, do you want to submit a PR for this change?

@danielrentz
Copy link
Contributor Author

@nzakas Sure!

danielrentz added a commit to danielrentz/markdown that referenced this issue Jan 17, 2025
fixes eslint#313 Remove typedef for a type not existing in @eslint/core
@github-project-automation github-project-automation bot moved this from Ready to Implement to Complete in Triage Jan 17, 2025
@carlocorradini
Copy link

Same problem here.
Could you please release a new minor or patch version?
Thanks 🙌

@fasttime
Copy link
Member

@carlocorradini Release v6.2.2 includes the fix.

@carlocorradini
Copy link

@fasttime Awesome thanks 🙌🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug repro:yes Issues with a reproducible example
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

4 participants