Skip to content

Conversation

@lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Jan 1, 2026

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 and removed /types export.

I've followed the same pattern as in eslint/json#198 and this PR aligns with the approach used in the Markdown repository in eslint/markdown#520 and eslint/markdown#564.

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

Also, I've removed the /types export, since the types are now re-exported by the main entry point.

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

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

N/A

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jan 1, 2026
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Jan 1, 2026
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jan 2, 2026
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Jan 17, 2026
@lumirlumir lumirlumir marked this pull request as ready for review January 17, 2026 14:27
Copilot AI review requested due to automatic review settings January 17, 2026 14:27
@lumirlumir lumirlumir requested a review from a team January 17, 2026 14:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the type exports to make all types available from the main entry point (@eslint/css) instead of requiring a separate import path (@eslint/css/types). This improves the developer experience by consolidating imports and aligns with the patterns established in the eslint/json and eslint/markdown repositories.

Changes:

  • Added export * from "./types.js" to the main index.js file to re-export type definitions
  • Created a dummy src/types.js file to enable type imports in the source code (works around TypeScript import resolution)
  • Removed the ./types export path from package.json
  • Updated test file to import types directly from @eslint/css instead of @eslint/css/types

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/index.js Added export statement to re-export types from types.js
src/types.js New dummy file that enables type exports from the main module during development
package.json Removed the separate /types export path, consolidating all exports through the main entry point
tests/types/types.test.ts Updated imports to use the new type export path from the main module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion breaking feature

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants