⚓ Oxc EnhanceA personal enhanced fork of the Oxc VS Code extension, providing editor integration for oxlint (linter) and oxfmt (formatter). Origin / 原始插件This extension is based on the official Oxc VS Code extension: marketplace.visualstudio.com — oxc.oxc-vscode The original extension provides:
Enhancements / 增强说明1.
|
| Key | Default Value | Possible Values | Description |
|---|---|---|---|
oxc.enable |
null |
true | false | <null> |
This is a master toggle for both oxc.enable.oxlint and oxc.enable.oxfmt. |
oxc.enable.oxfmt |
true |
true | false |
Enable oxfmt (formatter). Falls back to oxc.enable if not set. |
oxc.enable.oxlint |
true |
true | false |
Enable oxlint (linter). Falls back to oxc.enable if not set. |
oxc.fmt.requireConfig |
false |
true | false |
Start oxfmt only when a .oxfmtrc.json(c) or oxfmt.config.ts file exists in one of the workspaces. |
oxc.lint.requireConfig |
null |
true | false | <null> |
Start oxlint only when a .oxlintrc.json(c) or oxlint.config.ts file exists in one of the workspaces. Takes priority over oxc.requireConfig when set to a non-null value. |
oxc.path.node |
- | <string> |
Path to a Node.js binary. Will be added to the oxfmt and oxlint PATH environment. |
oxc.path.oxfmt |
- | <string> |
Path to an Oxc formatter binary. Default: auto detection in node_modules. |
oxc.path.oxlint |
- | <string> |
Path to an Oxc linter binary. Default: auto detection in node_modules. |
oxc.path.tsgolint |
- | <string> |
Path to an Oxc tsgolint binary. Default: auto detection from oxlint. |
oxc.requireConfig |
false |
true | false |
Alias for oxc.lint.requireConfig. Start oxlint only when a .oxlintrc.json(c) or oxlint.config.ts file exists in one of the workspaces. oxc.lint.requireConfig takes priority when both are set. |
oxc.suppressProgramErrors |
false |
true | false |
Suppress tsconfig errors from tsgolint and still lint files under partially-valid tsconfig projects. When enabled, sets OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true. Note: Type-aware lint rules may produce degraded results when the tsconfig is broken. |
oxc.trace.server |
off |
off | messages | verbose |
Traces the communication between VS Code and the language server. |
oxc.useExecPath |
false |
true | false |
Whether to use the extension's execPath (Electron's bundled Node.js) as the JavaScript runtime for running Oxc tools, instead of looking for a system Node.js installation. |
| Deprecated | |||
oxc.path.server |
- | <string> |
Path to Oxc language server binary. Mostly for testing the language server. |
Workspace Configuration
Following configurations are supported via settings.json and can be changed for each workspace:
| Key | Default Value | Possible Values | Description |
|---|---|---|---|
oxc.configPath |
null |
<string> | <null> |
Path to oxlint configuration. Keep it empty to enable nested configuration. |
oxc.disableNestedConfig |
false |
true | false |
Disable searching for nested configuration files. When set to true, only the configuration file specified in oxc.configPath (if any) will be used. |
oxc.fixKind |
null |
safe_fix | safe_fix_or_suggestion | dangerous_fix | dangerous_fix_or_suggestion | none | all |
Specify the kind of fixes to suggest/apply. |
oxc.fmt.configPath |
null |
<string> | <null> |
Path to an oxfmt configuration file |
oxc.lint.run |
onType |
onSave | onType |
Run the linter on save (onSave) or on type (onType) |
oxc.tsConfigPath |
null |
<string> | <null> |
Path to the project's TypeScript config file. If your tsconfig.json is not at the root, you will need this set for the import plugin rules to resolve imports correctly. |
oxc.typeAware |
null |
true | false | <null> |
Forces type-aware linting. Requires the oxlint-tsgolint package. It is preferred to use options.typeAware in your configuration file |
oxc.unusedDisableDirectives |
null |
allow | warn | deny |
Define how directive comments like // oxlint-disable-line should be reported, when no errors would have been reported on that line anyway. It is preferred to use options.reportUnusedDisableDirectives in your configuration file |
| Deprecated | |||
oxc.flags |
{} |
Record<string, string> |
Specific Oxlint flags to pass to the language server. |
oxc.fmt.experimental |
true |
true | false |
Enable Oxfmt formatting support. |
FixKind
"safe_fix"(default)"safe_fix_or_suggestion""dangerous_fix""dangerous_fix_or_suggestion""none""all"
RulesCustomization
Each rule name maps to an object with the following optional properties:
autofix:true|false— Whether autofix should be disabled for this rule.severity:"error"|"warning"|"info"|"hint"|"off"— Diagnostic severity override for this rule.
Example:
{
"oxc.lint.customization": {
"no-unused-vars": {
"severity": "warning",
"autofix": false
}
}
}
Acknowledgment / 致谢
This extension is forked from the official oxc-vscode extension, maintained by the Oxc project. All core functionality — the LSP client architecture, binary resolution, workspace configuration system, and the oxlint / oxfmt integrations — is built on their excellent work.
本插件 fork 自 oxc-project/oxc-vscode,感谢 Oxc 团队构建了如此出色的工具链与编辑器集成基础。