Skip to content

Commit 6faa11d

Browse files
TheAlexLichterautofix-ci[bot]Copilot
authored
docs(linter): show type-aware command if rule is tsgolint-based (#15041)
Inspired by #14587, the command flag was missing for them too. Expected: `oxlint --type-aware --deny typescript/await-thenable` Actual: `oxlint --deny typescript/await-thenable` <img width="840" height="259" alt="image" src="https://github.com/user-attachments/assets/b9c5dc4b-5dfc-4558-a6e9-5187a60df8f2" /> --------- Signed-off-by: Alexander Lichter <github@lichter.io> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b27c5b9 commit 6faa11d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tasks/website/src/linter/rules/doc_page.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,16 @@ fn how_to_use(rule: &RuleTableRow) -> String {
196196
format!("{}/{}", normalized_plugin_name, rule.name)
197197
};
198198
let is_default_plugin = is_default_plugin(plugin);
199+
let is_tsgolint_rule = rule.is_tsgolint_rule;
200+
201+
let type_aware_flag = if is_tsgolint_rule { "--type-aware " } else { "" };
202+
199203
let enable_bash_example = if is_default_plugin {
200-
format!(r"oxlint --deny {rule_full_name}")
204+
format!(r"oxlint {type_aware_flag}--deny {rule_full_name}")
201205
} else {
202-
format!(r"oxlint --deny {rule_full_name} --{normalized_plugin_name}-plugin")
206+
format!(
207+
r"oxlint {type_aware_flag}--deny {rule_full_name} --{normalized_plugin_name}-plugin"
208+
)
203209
};
204210
let enable_config_example = if is_default_plugin {
205211
format!(

0 commit comments

Comments
 (0)