Skip to content

Conversation

lumirlumir
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request?

In this PR, I've exported all types from src/types.ts through the main entry point.

Previously, to access the global types defined in src/types.ts, they had to be imported from @eslint/markdown/types. After this change, they can be imported directly from @eslint/markdown.

What changes did you make? (Give an overview)

To enable importing types from the main entry point, I used a small trick.

The types.ts file is built into types.js and types.d.ts.

In the built types.js, it's possible to re-export the type declarations from the main entry point using export * from "types.js".

However, that wasn't possible in the source. To bridge the gap, I added a dummy src/types.js file so types can be imported from src/types.ts.

Related Issues

Ref: eslint/json#130, eslint/json#130 (comment), #453, #367 (comment)

Is there anything you'd like reviewers to focus on?

N/A

@eslintbot eslintbot added this to Triage Sep 7, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Sep 7, 2025
@lumirlumir lumirlumir marked this pull request as ready for review September 7, 2025 12:08
@lumirlumir lumirlumir requested a review from a team September 7, 2025 12:08
@fasttime fasttime moved this from Needs Triage to Triaging in Triage Sep 8, 2025
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. Leaving open for a second review.

@fasttime fasttime moved this from Triaging to Second Review Needed in Triage Sep 8, 2025
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! IMO a single almost-blank file is not a very high price to pay for easier type imports.

Thanks for pushing on this @lumirlumir!

@lumirlumir
Copy link
Member Author

@JoshuaKGoldberg Thanks for understanding that I took on the issue you originally suggested.

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@nzakas nzakas merged commit 915837c into main Sep 9, 2025
24 checks passed
@nzakas nzakas deleted the feat-export-types-from-main-entry-point branch September 9, 2025 14:56
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

4 participants