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

#2935 Remove the .d.ts file and rely on JSDocs entirely #3060

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

mayankkamboj47
Copy link
Contributor

When we import values in a Typescript project, Typescript automatically infers the types using JSDoc comments if possible: https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#providing-type-hints-in-js-via-jsdoc. The present index.d.ts file is then just a redundancy on top of the Eleventy.js file, and requires additional maintenance to keep it up to date.

This fixes #2935

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Oct 27, 2023
@zachleat
Copy link
Member

zachleat commented Nov 3, 2023

I’d love to follow Svelte’s lead here and simplify things! cc to @Ryuno-Ki for their take too

@mayankkamboj47
Copy link
Contributor Author

@zachleat Can you elaborate ? I checked svelte's repo and they seem to be using a mixture of jsdoc and .d.ts files. Also tagging @Ryuno-Ki for their thoughts

@zachleat
Copy link
Member

zachleat commented Nov 6, 2023

@mayankkamboj47 sveltejs/kit#4429 (comment) has some info. I think the Svelte(Kit?) maintainers infamously chose JSDoc over full TypeScript awhile back.

@uncenter
Copy link
Contributor

uncenter commented Nov 9, 2023

I think .d.ts files are different than using TypeScript though.
https://github.com/search?q=repo:sveltejs/svelte%20path:*.d.ts&type=code

@zachleat
Copy link
Member

Merged with a few additions, thank you! Readded jsdoc to the npm scripts @Ryuno-Ki (though it’s .npmignore’d too) and I believe the goal here is to document the supported user-land configuration API (Eleventy.js and UserConfig.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Type definitions and Typescript issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module '@11ty/eleventy' has no exported member 'EleventyRenderPlugin'
3 participants