Skip to content

[Enhancement] Generate language-specific overrides in .vscode/settings.json #1485

@vpckso

Description

@vpckso

Description

The Problem

When generating configurations for VS Code, the current template only outputs a global editor.defaultFormatter.

Because of VS Code's Settings Precedence, any language-specific configuration in a user's global settings.json will take priority over a workspace-level global setting. This means if a user has Prettier set specifically for TypeScript in their global settings, the generated workspace setting for oxc-vscode is ignored.

Precedence Conflict

  1. User Settings (Global - High Priority):
    "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }
  2. Generated Workspace Settings (Low Priority):
    "editor.defaultFormatter": "oxc.oxc-vscode"

Result: VS Code uses Prettier, ignoring the project's intent to use OXC.

Suggested solution

When the VS Code configuration is generated, the tool should include language-specific blocks based on the project template (e.g., [typescript], [typescriptreact], [javascript]). This ensures the workspace setting correctly overrides any existing user-level language settings.

Target Output for .vscode/settings.json for typescript react project:

{
  "editor.defaultFormatter": "oxc.oxc-vscode",
  "[typescript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "oxc.oxc-vscode"
  }
}

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
  • Check that there isn't already an issue requesting the same feature.

Metadata

Metadata

Assignees

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions