Reproduction
In a Vite+ project, formatting rules are configured in vite.config.ts:
export default defineConfig({
fmt: {
singleQuote: true,
semi: false,
trailingComma: 'all',
},
})
VS Code workspace settings follow the documented recommendation:
{
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit"
}
}
What happens
vp check --fix formats files according to fmt in vite.config.ts
- VS Code format-on-save uses OXC formatter behavior that does not appear to read the same config source
- this causes formatting drift between editor save and command-line formatting
For example:
- save in editor turns strings into double quotes
vp check --fix turns them back to single quotes because singleQuote: true is set in vite.config.ts
Expected behavior
The documented editor setup should stay consistent with vp fmt / vp check --fix, or the docs should explicitly state that editor formatting needs a separate OXC-native config file.
Questions
- Is VS Code format-on-save expected to read
fmt from vite.config.ts?
- If not, what is the recommended single source of truth for formatting rules in a Vite+ project?
Notes
I was able to confirm that vp fmt --write respects singleQuote: true, so the mismatch seems to be between Vite+ config-driven formatting and editor integration.
Reproduction
In a Vite+ project, formatting rules are configured in
vite.config.ts:VS Code workspace settings follow the documented recommendation:
{ "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, "editor.formatOnSaveMode": "file", "editor.codeActionsOnSave": { "source.fixAll.oxc": "explicit" } }What happens
vp check --fixformats files according tofmtinvite.config.tsFor example:
vp check --fixturns them back to single quotes becausesingleQuote: trueis set invite.config.tsExpected behavior
The documented editor setup should stay consistent with
vp fmt/vp check --fix, or the docs should explicitly state that editor formatting needs a separate OXC-native config file.Questions
fmtfromvite.config.ts?Notes
I was able to confirm that
vp fmt --writerespectssingleQuote: true, so the mismatch seems to be between Vite+ config-driven formatting and editor integration.