Skip to content

refactor(linter/plugins): remove deprecated exports from index entry point#18828

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point
Feb 3, 2026
Merged

refactor(linter/plugins): remove deprecated exports from index entry point#18828
graphite-app[bot] merged 1 commit intomainfrom
om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Feb 2, 2026

Remove re-exports of definePlugin, defineRule and RuleTester from main index entry point of oxlint package.

We want this to be cheap:

import { defineConfig } from "oxlint";

But with the deprecated exports, this would eagerly load ~20,000 lines of JS plugins-related code. See index.js in dist directory before and after this PR in release build. It was the import from ./lint.js which was massive.

Personally, I don't think we need to keep the deprecated exports, for 3 reasons:

  1. We have very clearly said that JS plugins are experimental and that breaking changes are very possible.
  2. Given how broken our types are at present, probably few people were using definePlugin and defineRule anyway!
  3. The fix for users who do get broken is trivial:
- import { definePlugin } from "oxlint";
+ import { definePlugin } from "@oxlint/plugins";

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI labels Feb 2, 2026
Copy link
Member Author

overlookmotel commented Feb 2, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added the A-linter-plugins Area - Linter JS plugins label Feb 2, 2026
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Feb 2, 2026
@overlookmotel overlookmotel marked this pull request as ready for review February 2, 2026 01:22
Copilot AI review requested due to automatic review settings February 2, 2026 01:22
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 removes deprecated re-exports of definePlugin, defineRule, and RuleTester from the main oxlint package entry point (index.ts). The goal is to make importing defineConfig from the main entry point lightweight, avoiding the eager loading of approximately 20,000 lines of plugins-related JavaScript code.

Changes:

  • Removed deprecated exports from apps/oxlint/src-js/index.ts that redirected to plugin-specific modules
  • These functions remain available from their proper locations: definePlugin and defineRule from oxlint/plugins (or @oxlint/plugins), and RuleTester from oxlint/plugins-dev

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

@overlookmotel overlookmotel force-pushed the om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point branch 3 times, most recently from 5504055 to 74ad0f7 Compare February 2, 2026 02:18
@overlookmotel overlookmotel changed the base branch from om/02-02-feat_linter_plugins_add_oxlint_plugins_npm_package to graphite-base/18828 February 3, 2026 10:38
@overlookmotel overlookmotel force-pushed the om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point branch from 74ad0f7 to 76d5efd Compare February 3, 2026 10:38
@overlookmotel overlookmotel changed the base branch from graphite-base/18828 to main February 3, 2026 10:38
@overlookmotel overlookmotel force-pushed the om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point branch from 76d5efd to 96372ff Compare February 3, 2026 14:09
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Feb 3, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 3, 2026

Merge activity

…y point (#18828)

Remove re-exports of `definePlugin`, `defineRule` and `RuleTester` from main `index` entry point of `oxlint` package.

We want this to be cheap:

```js
import { defineConfig } from "oxlint";
```

But with the deprecated exports, this would eagerly load ~20,000 lines of JS plugins-related code. See `index.js` in `dist` directory before and after this PR in release build. It was the import from `./lint.js` which was massive.

Personally, I don't think we need to keep the deprecated exports, for 3 reasons:

1. We have very clearly said that JS plugins are experimental and that breaking changes are very possible.
2. Given how broken our types are at present, probably few people were using `definePlugin` and `defineRule` anyway!
3. The fix for users who do get broken is trivial:

```diff
- import { definePlugin } from "oxlint";
+ import { definePlugin } from "@oxlint/plugins";
```
@graphite-app graphite-app bot force-pushed the om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point branch from 96372ff to b7416d0 Compare February 3, 2026 15:46
@graphite-app graphite-app bot merged commit b7416d0 into main Feb 3, 2026
19 of 20 checks passed
@graphite-app graphite-app bot deleted the om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point branch February 3, 2026 15:53
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 3, 2026
graphite-app bot pushed a commit that referenced this pull request Feb 4, 2026
Continuation of #18824, #18828, #18903.

Remove the `oxlint/plugins` export and the `plugins.ts` entry point. These are now only used in tests, where the files can be loaded from `dist-pkg-plugins` instead.

We don't want to encourage people to use `oxlint/plugins` in their plugins - they should be using `@oxlint/plugins` package instead to avoid their plugin having a dependency on `oxlint`.

Due to less shared dependencies between files, this results in 5 less files in `dist` directory in release build.

This also allows re-enabling the debug assertions in this code in tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments