Release/15.0.1#456
Merged
Merged
Conversation
The `exports` field in each of our ESLint config packages used an
`import` condition with no `require` or `default` condition alongside
it, which broke compatbility with CommonJS. The condition has been
removed.
This has no impact on ESM modules, but it allows import from CommonJS
modules.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Packaging-only `exports` map change with identical entry file paths;
low risk aside from verifying CJS and ESM consumers still resolve types
and the main entry.
>
> **Overview**
> Fixes **CommonJS consumers** (e.g.
`require('@metamask/eslint-config')` or CJS ESLint configs) that could
not resolve these packages because `package.json` `exports["."]` only
defined an **`import`** condition.
>
> Across all eight published config packages (`base`, `browser`,
`commonjs`, `jest`, `mocha`, `nodejs`, `typescript`, `vitest`), the
export map is flattened so **`types`** and **`default`** sit directly
under `"."` instead of under `import`. Resolution still points at the
same `./src/index.mjs` and `./src/index.d.mts` files; **ESM `import`
behavior is unchanged**, while **`default`** can be used when the
resolver does not apply the `import` condition.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
00f5812. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Changelogs have been updated for #453 (I forgot to update them in the PR). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changelog-only follow-up with no behavioral or dependency changes. > > **Overview** > Adds **Unreleased** changelog entries across the monorepo packages (`base`, `browser`, `commonjs`, `jest`, `mocha`, `nodejs`, `typescript`, `vitest`) for the fix shipped in [#453](#453): **Allow import from CommonJS**. > > `packages/base` gets a new **Fixed** section under `[Unreleased]`; the other packages add the same bullet under **Fixed**. `packages/typescript` appends the entry to its existing **Fixed** section rather than creating a new one. > > No runtime or config code changes—documentation only, catching up release notes that were omitted when #453 merged. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 27b5540. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a release candidate for v15.0.1, a backport release for v15.x
Note
Low Risk
Packaging-only change with no lint rule or runtime logic edits; risk is limited to module resolution behavior for consumers on 15.0.0.
Overview
v15.0.1 is a patch backport across all
@metamask/eslint-config*workspace packages (root and eight published configs).The functional change is in each package’s
exportsmap: the entry point no longer uses animport-only nested condition.typesanddefaultnow sit directly on".", so Node can resolve the publishedindex.mjsfor consumers that load the package from CommonJS (e.g. legacyeslint.config.jsor tooling thatrequires the config), addressing #453.Versions move 15.0.0 → 15.0.1; changelogs record the fix under [15.0.1] [BACKPORT] with updated compare links. No ESLint rule or source config changes are in this diff.
Reviewed by Cursor Bugbot for commit a3ad788. Bugbot is set up for automated code reviews on this repo. Configure here.