mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
b7416d06a9
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";
```
15 lines
273 B
TypeScript
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";
|