Closed
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
hast-util-to-jsx-runtime@2.3.2
Steps to reproduce
- Configure
@typescript-eslint/no-unsafe-return
rule in some Node.js or Next.js project (eg. Next.js App Router project) - Add Shiki example code for
hast-util-to-jsx-runtime
incomponents/CodeBlock.tsx
- 💥 Observe "Unsafe return of a value of type error" error with return value
Reproduction (typescript-eslint
Playground)
Unsafe return of a value of type error. 12:3 - 20:6
Using a as JSX.element
type assertion on the return value of toJsxRuntime()
is a workaround for the issue:
Actual behavior
Error with a "type error". The type error is not observable.
Expected behavior
No error
Runtime
node@22.11.0
Package manager
yarn@1.22.22
Operating system
macOS Sequoia 15.1.1
Build and bundle tools
other (please specify in steps to reproduce)