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!
- 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
- 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
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
Currently,
lint|fmtIDE support for Vite+ is implemented as follows:vite-pluspackage is installed locally, the package manager placesbin/oxlint|fmtvite.config.tssupport enabled, distinct from the standardoxlint|fmtbinaries--lspHowever, some issues have also come to light.
npmoryarnas the package manager, the custom binary is not installed at all!bins conflict withoxfmtandoxlintbins #1482pnpmandbunworksoxlint|fmtseparately overwrites the custom binaryvp lint|fmttoobin/was lower than that ofrequire.resolve(), causing it to fail to locate the custom binary when other workspaces were opennode_modules/.binbefore resolving to native package oxc-project/oxc-vscode#223Proposed solution
Following our team meeting, we would like to proceed as follows.
vp lint|fmt --lspinsteadvp fmt --stdin-filepathTasks
VITE+...header message to stdout for these usecases @fengmk2vp lint --lspvp fmt --lsp,vp fmt --stdin-filepathvp lint|fmt --lsp