Skip to content

Commit fcf7702

Browse files
committedMar 26, 2025·
fix(language_server): start from a default oxlint configuration + SafeFix for nested configuration (#10043)
Bug 1: oxlint uses `ConfigStoreBuilder::from_oxlintrc(false)` everywhere. The result was: A project without a configuration file would not use the default category + plugins for vscode => no rules activated Bug 2: `SafeFix` was not implemented for nested configuration
1 parent c971328 commit fcf7702

File tree

1 file changed

+5
-7
lines changed
  • crates/oxc_language_server/src

1 file changed

+5
-7
lines changed
 

Diff for: ‎crates/oxc_language_server/src/main.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -552,25 +552,23 @@ impl Backend {
552552
Oxlintrc::default()
553553
};
554554

555-
let config_store = ConfigStoreBuilder::from_oxlintrc(true, oxlintrc.clone())
555+
let config_store = ConfigStoreBuilder::from_oxlintrc(false, oxlintrc.clone())
556556
.expect("failed to build config")
557557
.build()
558558
.expect("failed to build config");
559559

560+
let lint_options = LintOptions { fix: FixKind::SafeFix, ..Default::default() };
561+
560562
let linter = if self.options.lock().await.disable_nested_configs() {
561-
Linter::new(LintOptions::default(), config_store).with_fix(FixKind::SafeFix)
563+
Linter::new(lint_options, config_store)
562564
} else {
563565
let nested_configs = self.nested_configs.pin();
564566
let nested_configs_copy: FxHashMap<PathBuf, ConfigStore> = nested_configs
565567
.iter()
566568
.map(|(key, value)| (key.clone(), value.clone()))
567569
.collect::<FxHashMap<_, _>>();
568570

569-
Linter::new_with_nested_configs(
570-
LintOptions::default(),
571-
config_store,
572-
nested_configs_copy,
573-
)
571+
Linter::new_with_nested_configs(lint_options, config_store, nested_configs_copy)
574572
};
575573

576574
*self.server_linter.write().await = ServerLinter::new_with_linter(linter);

0 commit comments

Comments
 (0)
Please sign in to comment.