Ship Starlight using .js + .d.ts files
#983
HiDeoo
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare you using?0.11.1
What is your idea?
Starlight is currently shipped as TypeScript code with no
.d.tsfiles. This suggests to compile the TypeScript code and ship.js+.d.tsfiles.Why is this feature necessary?
This discussion is a follow-up of #861.
Typechecking code importing various parts of Starlight can currently be difficult due to the fact that
@astrojs/starlightis not compiled and ship TypeScript code with no.d.tsfiles.For example, an integration importing a TypeScript file from
@astrojs/starlightcould fail to typecheck withtsc --noEmitfor some stylistic reasons likenoPropertyAccessFromIndexSignatureif the integration uses this rule but@astrojs/starlightdoesn't as the Starlight shipped TypeScript code will be typechecked with the integration'stsconfig.json.As commented by a TS maintainer in this comment or this one, this is expected behavior with such a setup. The solution is to compile the TypeScript code and ship
.js+.d.tsfiles.Notes:
astro-scriptswill not be a solution as this is not publishedDo you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions