Files
oxc-project__oxc/apps/oxlint/src-js/index.ts
overlookmotel b7416d06a9 refactor(linter/plugins): remove deprecated exports from index entry 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";
```
2026-02-03 15:46:17 +00:00

15 lines
273 B
TypeScript

export { defineConfig } from "./package/config.ts";
export type {
AllowWarnDeny,
OxlintEnv,
DummyRule,
DummyRuleMap,
ExternalPluginEntry,
OxlintGlobals,
RuleCategories,
ExternalPluginsConfig,
OxlintConfig,
OxlintOverride,
} from "./package/config.ts";