voidzero-dev / voidzero-dev/vite-plus
Allow configuring the Oxlint output format for `vp lint` and `vp check`
- 主要言語
- Rust
- スター
- 5.8k
- フォーク
- 262
- 平均マージ
- 23時間 18分
- マージ済み PR(30日)
- 139
説明
### Description
`vp lint` supports selecting an Oxlint output format through the CLI:
```sh
vp lint --format=agent
```
However, there is no equivalent project-level setting in `vite.config.ts`. In addition, `vp check` does not accept `--format` or provide another way to control the output format of its lint phase.
Vitest already supports configuring agent-friendly output centrally:
```ts
export default defineConfig({
test: {
reporters: ["agent"],
silent: "passed-only",
},
});
```
It would be useful to configure Oxlint output in the same place so that local development, coding agents, CI, `vp check`, and staged checks all use consistent diagnostics.
Oxlint automatically selects the agent formatter in some recognized agent environments, but this behavior is environment-dependent and does not cover every coding-agent harness. It also does not let a project enforce deterministic output across different environments.
Without a configuration option, projects must maintain separate package scripts and ensure every caller knows which script to use.
### Suggested solution
Add a Vite+ configuration option for the Oxlint output format. For example:
```ts
export default defineConfig({
lint: {
format: "agent",
},
});
```
The option should:
- Apply to `vp lint`
- Apply to the lint phase of `vp check`
- Apply when those commands are invoked through `vp staged`
- Support the same values as Oxlint’s `--format` option
- Preserve the current behavior when omitted
- Allow an explicit CLI `--format` argument to override the configured value
For `vp check`, the configured format should apply only to lint diagnostics while preserving Vite+’s own formatting and summary output.
Since output format is currently an Oxlint CLI option rather than part of `OxlintConfig`, Vite+ could treat this as command configuration and pass it separately to the Oxlint runner.
### Alternative
As a workaround:
```json
{
"scripts": {
"lint": "vp lint --format=agent",
"check": "vp fmt --check && vp lint --format=agent"
}
}
```
This has several drawbacks:
- It bypasses the integrated `vp check` execution path
- It duplicates Vite+ command behavior
- It requires staged hooks, CI, contributors, and coding agents to know which script to invoke
- It can diverge from the project’s normal `vp check` behavior
Another alternative is to rely on Oxlint’s automatic agent-environment detection. This is not deterministic across environments and does not currently recognize every agent harness.
### Additional context
## Related issues
- [#925](https://github.com/voidzero-dev/vite-plus/issues/925) concerns preserving the automatically selected GitHub reporter in `vp check`.
- [#2035](https://github.com/voidzero-dev/vite-plus/issues/2035) discusses Oxlint’s environment-dependent reporter selection and clean-pass output.
- [oxc-project/oxc#20514](https://github.com/oxc-project/oxc/issues/20514) implemented the agent formatter and automatic agent detection.
- [oxc-project/oxc#19072](https://github.com/oxc-project/oxc/issues/19072) proposes an environment-variable override for compact agent output.
This request is specifically about defining a deterministic, project-level output format in `vite.config.ts` and applying it consistently to both `vp lint` and `vp check`.
### Validations
- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- [x] Check that there isn't already an issue requesting the same feature.
コントリビューションガイド
調査の方向性
vite.config.ts の設定エントリーポイントと vp lint および vp check のコマンドパスから始め、vp staged を介して lint フェーズがどのように呼び出されるかも追跡します。Oxlint の引数がどのように組み立てられるかを確認し、設定された形式と CLI で指定された形式が lint 診断に適用される一方で、vp check は独自のサマリー出力を維持し、設定を省略した場合は現在の動作が維持されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- cli, developer-experience, tooling
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 65/100