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 resolved the issue mentioned in #196, removing rollup and extraneous types and migrating the package to ESM-only.

The main focus of this PR is removing much of the logic and the workarounds we previously used to support a dual CommonJS/ESM package.

Some notable parts are as follows:

What changes did you make? (Give an overview)

In this PR, I've resolved the issue mentioned in #196, removing rollup and extraneous types and migrating the package to ESM-only.

Related Issues

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

I didn't intentionally remove tests/types/cjs-import.test.cts since require(ESM) is now enabled. However, if removing it is the right course of action, I'm happy to do so.

@eslint-github-bot eslint-github-bot bot added breaking bug Something isn't working labels Jan 1, 2026
@eslintbot eslintbot added this to Triage Jan 1, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jan 1, 2026
"npm run build:update-rules-docs"
],
"{src/rules/*.js,tools/update-rules-docs.js}": [
"{src/rules/*.js,tools/update-rules-docs.js,README.md}": [
Copy link
Member Author

Choose a reason for hiding this comment

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

README.md pre-commit hook update can be consolidated into a single line, I went ahead. Just for a reference, the Markdown plugin also uses this approach:

Ref: https://github.com/eslint/markdown/blob/main/package.json#L56-L59

@lumirlumir lumirlumir marked this pull request as ready for review January 2, 2026 08:47
Copilot AI review requested due to automatic review settings January 2, 2026 08:47
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Jan 2, 2026
@lumirlumir lumirlumir requested a review from a team January 2, 2026 08:48
Copy link

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 migrates the @eslint/json package from a dual CommonJS/ESM format to ESM-only, removing the Rollup bundler and associated build complexity. The migration simplifies the build process by eliminating workarounds previously needed to support both module formats.

Key changes:

  • Replaced Rollup-based bundling with TypeScript compilation that emits both JavaScript and declaration files
  • Simplified package.json exports to use a single ESM entry point instead of dual CJS/ESM conditional exports
  • Updated all internal type imports from .ts to .js extensions to comply with ESM module resolution

Reviewed changes

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

Show a summary per file
File Description
tsconfig.json Simplified TypeScript configuration for ESM-only output, removing dual-format compilation settings and consolidating output to single dist/ directory
tsconfig.esm.json Removed secondary TypeScript configuration file that was used for ESM-specific type generation
tools/dedupe-types.js Removed script that deduped type imports after rollup bundling, no longer needed without rollup
tools/build-cts.js Removed script that generated CommonJS type definitions (.cts files), no longer needed for ESM-only package
rollup.config.js Removed Rollup configuration and bundler from build process
package.json Updated exports to ESM-only format, simplified build scripts, added @arethetypeswrong/cli for type validation, removed rollup dependencies, consolidated lint-staged configuration
src/rules/*.js Updated type imports from ../types.ts to ../types.js to follow ESM conventions
src/languages/json-source-code.js Updated type import from ../types.ts to ../types.js
jsr.json Updated export paths and simplified publish configuration to reference consolidated dist/ directory
.github/workflows/ci.yml Added new CI job to validate type definitions using @arethetypeswrong/cli

💡 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 breaking bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

Change Request: Remove rollup and migrate to ESM-only as part of the upcoming v1.0.0 (JSON/CSS)

2 participants