refactor(linter): split entry points for custom plugins/config/types#18601
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
88fa054 to
742c57f
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the oxlint package to split entry points for custom plugins, rule testing, and configuration. The goal is to separate concerns and reduce bundle size for users who only need configuration imports without bringing in custom plugin code.
Changes:
- Add new entry points
oxlint/pluginandoxlint/rule-testerfor custom plugin and rule testing APIs - Update package.json exports to include the new entry points
- Deprecate
definePlugin,defineRule, andRuleTesterexports from main entry point with JSDoc warnings - Move all TypeScript type exports to the
plugin.tsentry point
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| npm/oxlint/package.json | Adds exports configuration for new entry points (./plugin and ./rule-tester) |
| apps/oxlint/package.json | Adds exports and imports configuration for new entry points |
| apps/oxlint/tsdown.config.ts | Updates build configuration to include new entry point files in the build |
| apps/oxlint/src-js/plugin.ts | New entry point exporting definePlugin, defineRule, and all plugin-related types |
| apps/oxlint/src-js/rule-tester.ts | New entry point exporting RuleTester class |
| apps/oxlint/src-js/index.ts | Refactored to only export deprecated functions, removes all type exports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Good idea to move But I don't particularly see the benefit of moving I actually think |
Yeah I'm adding |
ddba0f7 to
dcf2a20
Compare
Ah ha now it makes sense. Would appreciate your thoughts on #18610 when you have time. |
32fbe3d to
b1c5f35
Compare
dcf2a20 to
10510d6
Compare
10510d6 to
5eeb708
Compare
overlookmotel
left a comment
There was a problem hiding this comment.
Pushed a commit to fix lint errors. Merging.
|
🙏i couldn't work out why it was failing. thanks |
Merge activity
|
…18601) This is technically breaking (only for types), but custom plugins are experimental. The ruletester/defineRule/definePlugin are re-exported but with a `@deprecated` tag which I think is a good enough trade off I want to avoid users bringing in a ton of custom plugin code when doing `import { defineConfig } from 'oxlint'`
0541569 to
81eb6fa
Compare
The configuration_schema.json file was not accessible after adding the `exports` field in oxc-project#18601. This adds the missing export entry. Fixes the import: `import schema from 'oxlint/configuration_schema.json'`

This is technically breaking (only for types), but custom plugins are experimental.
The ruletester/defineRule/definePlugin are re-exported but with a
@deprecatedtag which I think is a good enough trade offI want to avoid users bringing in a ton of custom plugin code when doing
import { defineConfig } from 'oxlint'