Skip to content

Commit 68a2280

Browse files
committed
fix(linter/plugins): more graceful exit for --experimental-js-plugins CLI option (#13688)
`--experimental-js-plugins` option is not supported in `oxlint` at present. Exit more gracefully if it's used.
1 parent 08c05df commit 68a2280

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/oxlint/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ pub fn lint(mut external_linter: Option<ExternalLinter>) -> CliRunResult {
5555

5656
command.handle_threads();
5757

58+
#[expect(clippy::print_stderr)]
5859
if command.experimental_js_plugins {
59-
// If this assertion fails, this function was not called by `napi/oxlint2`.
60-
assert!(external_linter.is_some(), "JS plugins are not supported at present");
60+
// If no `ExternalLinter`, this function was not called by `napi/oxlint2`
61+
if external_linter.is_none() {
62+
eprintln!("ERROR: JS plugins are not supported at present");
63+
return CliRunResult::InvalidOptionConfig;
64+
}
6165
} else {
6266
external_linter = None;
6367
}

0 commit comments

Comments
 (0)