Skip to content

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

Merged
graphite-app[bot] merged 1 commit into
mainfrom
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 into
mainfrom
om/02-02-refactor_linter_plugins_remove_deprecated_exports_from_index_entry_point

Conversation

@overlookmotel

@overlookmotel overlookmotel commented Feb 2, 2026

Copy link
Copy Markdown
Member

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

overlookmotel commented Feb 2, 2026

Copy link
Copy Markdown
Member Author

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread apps/oxlint/src-js/index.ts
@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

graphite-app Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

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.
stickerdaniel added a commit to stickerdaniel/saas-starter that referenced this pull request May 1, 2026
- Patch oxlint-plugin-convex@0.1.1 to import definePlugin/defineRule
  from @oxlint/plugins (oxlint moved them out of its main entry point
  starting in 1.45 — see oxc-project/oxc#18828)
- Drop resolve('#') in team-two.svelte; sveltekit 2.58 made resolve()
  strict and rejects non-absolute paths (sveltejs/kit#15733)
- Ignore varlock-generated env types in eslint (varlock 0.9 emits
  @ts-nocheck, tripping ban-ts-comment)
- Drop now-stale eslint-disable directives surfaced by typescript-eslint

See also: juliusmarminge/agent-tools#26
stickerdaniel added a commit to stickerdaniel/saas-starter that referenced this pull request May 1, 2026
* fix(deps): update all non-major dependencies

* fix(deps): unblock CI on oxlint 1.45+ and sveltekit 2.58

- Patch oxlint-plugin-convex@0.1.1 to import definePlugin/defineRule
  from @oxlint/plugins (oxlint moved them out of its main entry point
  starting in 1.45 — see oxc-project/oxc#18828)
- Drop resolve('#') in team-two.svelte; sveltekit 2.58 made resolve()
  strict and rejects non-absolute paths (sveltejs/kit#15733)
- Ignore varlock-generated env types in eslint (varlock 0.9 emits
  @ts-nocheck, tripping ban-ts-comment)
- Drop now-stale eslint-disable directives surfaced by typescript-eslint

See also: juliusmarminge/agent-tools#26

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Sticker <daniel.sticker@rwth-aachen.de>
stickerdaniel added a commit to stickerdaniel/saas-starter that referenced this pull request Jun 3, 2026
* fix(deps): update all non-major dependencies

* fix(deps): unblock CI on oxlint 1.45+ and sveltekit 2.58

- Patch oxlint-plugin-convex@0.1.1 to import definePlugin/defineRule
  from @oxlint/plugins (oxlint moved them out of its main entry point
  starting in 1.45 — see oxc-project/oxc#18828)
- Drop resolve('#') in team-two.svelte; sveltekit 2.58 made resolve()
  strict and rejects non-absolute paths (sveltejs/kit#15733)
- Ignore varlock-generated env types in eslint (varlock 0.9 emits
  @ts-nocheck, tripping ban-ts-comment)
- Drop now-stale eslint-disable directives surfaced by typescript-eslint

See also: juliusmarminge/agent-tools#26

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Sticker <daniel.sticker@rwth-aachen.de>
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.

3 participants