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
-
What version of
starlight
are you using?0.11.1
What is your idea?
Starlight is currently shipped as TypeScript code with no
.d.ts
files. This suggests to compile the TypeScript code and ship.js
+.d.ts
files.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/starlight
is not compiled and ship TypeScript code with no.d.ts
files.For example, an integration importing a TypeScript file from
@astrojs/starlight
could fail to typecheck withtsc --noEmit
for some stylistic reasons likenoPropertyAccessFromIndexSignature
if the integration uses this rule but@astrojs/starlight
doesn'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.ts
files.Notes:
astro-scripts
will 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