Skip to content

Broken with oxlint >= 1.45.0: './plugins' subpath removed #39

@mattstrayer

Description

@mattstrayer

Problem

Starting with oxlint@1.45.0, the ./plugins subpath export was removed from the oxlint npm package. The plugin authoring APIs (definePlugin, defineRule, eslintCompatPlugin) have been moved to a new standalone package: @oxlint/plugins.

This causes oxlint-plugin-complexity to fail when used with oxlint >= 1.45.0:

Failed to load JS plugin: oxlint-plugin-complexity
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './plugins' is not defined by "exports" in oxlint/package.json

Root Cause

The compiled source (dist/index.js) imports from oxlint/plugins:

import { definePlugin } from 'oxlint/plugins';

This subpath no longer exists in oxlint >= 1.45.0.

Suggested Fix

Update the import to use the new standalone package:

import { definePlugin } from '@oxlint/plugins';

And add @oxlint/plugins as a peer dependency (or dependency).

Workaround

Pinning oxlint to 1.43.0 (the last version with the ./plugins export) works in the meantime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions