voidzero-dev / voidzero-dev/vite-plus

lint,fmt: Deprecate the wrapper bin for stable IDE support

Open
#1,557 14 comments 4 reactions 2 assignees Claimed by @leaysgur View on GitHub
Dominant language
Rust
Stars
5.8k
Forks
262
Avg merge
1d 34m
Merged PRs (30d)
135

Description

Currently, `lint|fmt` IDE support for Vite+ is implemented as follows:

- When the `vite-plus` package is installed locally, the package manager places `bin/oxlint|fmt`
- These are special binaries with `vite.config.ts` support enabled, distinct from the standard `oxlint|fmt` binaries
- Individual editor extensions then reference these binaries and launch `--lsp`
- The discovery process for these binaries should remain the same as in non-Vite+ projects

However, some issues have also come to light.

- When using `npm` or `yarn` as the package manager, the custom binary is not installed at all!
- #1482
- `pnpm` and `bun` works
- Installing `oxlint|fmt` separately overwrites the custom binary
- IMO: This should be triaged as a separate issue, since this overrides `vp lint|fmt` too
- When you try to setup editor by yourself, it's unclear to know what should be used
- #979
- The priority of the method VSCode extension uses to search the `bin/` was lower than that of `require.resolve()`, causing it to fail to locate the custom binary when other workspaces were open
- Fixed by: https://github.com/oxc-project/oxc-vscode/pull/223

### Proposed solution

Following our team meeting, we would like to proceed as follows.

- Deprecate the wrapper binary
- Editors that support LSP should use `vp lint|fmt --lsp` instead
- Editors that do not use LSP should use commands like `vp fmt --stdin-filepath`

### Tasks

- [x] Stop writing `VITE+...` header message to stdout for these usecases @fengmk2
- `vp lint --lsp`
- `vp fmt --lsp`, `vp fmt --stdin-filepath`
- [ ] Define a standardized way to determine "whether a project is a Vite+ project or not" @fengmk2
- [ ] Update editor extensions to detect Vite+ project and use `vp lint|fmt --lsp`
- [ ] https://github.com/oxc-project/oxc-vscode
- [ ] https://github.com/oxc-project/oxc-zed
- [ ] https://github.com/oxc-project/oxc-intellij-plugin
- [ ] https://github.com/oxc-project/coc-oxc
- [ ] Update docs?
- [ ] Remove wrapper bin

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.