Problem found in #21481, should fail on main too.
The oxfmt or oxlint LSP server only checks for vite.config.ts files, if the VP_VERSION is set.
This can create a problem, when we support files outside the current workspace.
Example
This example shows how the vite config will not be respected, when linting from a non vite project.
Setup
Project A: /home/project-a/
Has vite-plus installed and a vite.config.ts file in the root.
Project B: /home/project-b/
Uses oxfmt native without the VP_VERSION env.
Steps
- Open project B in your editor, like
code /home/project-b/
- Drag a file from Project A into your editor
- Format the dragged file
Problem
Because we started the server from /home/project-b/node_modules/.bin/oxfmt, we do not set the VP_VERSION environment for the language server.
The editor will format the file with default oxfmt settings and does not search the vite.config.ts file in /home/project-a/.
Problem found in #21481, should fail on
maintoo.The
oxfmtoroxlintLSP server only checks forvite.config.tsfiles, if theVP_VERSIONis set.This can create a problem, when we support files outside the current workspace.
Example
This example shows how the vite config will not be respected, when linting from a non vite project.
Setup
Project A:
/home/project-a/Has
vite-plusinstalled and avite.config.tsfile in the root.Project B:
/home/project-b/Uses
oxfmtnative without theVP_VERSIONenv.Steps
code /home/project-b/Problem
Because we started the server from
/home/project-b/node_modules/.bin/oxfmt, we do not set theVP_VERSIONenvironment for the language server.The editor will format the file with default
oxfmtsettings and does not search thevite.config.tsfile in/home/project-a/.