diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-08-19 23:42:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-19 20:42:13 +0000 |
commit | 4285cb339d4ddfe564a98b030bcba6c621584e81 (patch) | |
tree | d049aa0560b1b00e00a0e2710a9480ced4772b04 /cli/tools/lint/mod.rs | |
parent | b5051e25c219c188f17d499ee4e101a64eb62e37 (diff) |
fix(lint): support linting tsx/jsx from stdin (#24955)
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'cli/tools/lint/mod.rs')
-rw-r--r-- | cli/tools/lint/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/tools/lint/mod.rs b/cli/tools/lint/mod.rs index efa11f03c..5b51b2b40 100644 --- a/cli/tools/lint/mod.rs +++ b/cli/tools/lint/mod.rs @@ -151,7 +151,10 @@ pub async fn lint( lint_options.rules, start_dir.maybe_deno_json().map(|c| c.as_ref()), )?; - let file_path = cli_options.initial_cwd().join(STDIN_FILE_NAME); + let mut file_path = cli_options.initial_cwd().join(STDIN_FILE_NAME); + if let Some(ext) = &lint_flags.ext { + file_path.set_extension(ext); + } let r = lint_stdin(&file_path, lint_rules, deno_lint_config); let success = handle_lint_result( &file_path.to_string_lossy(), |