diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-03-21 11:46:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 15:46:40 +0000 |
commit | 2fcf1f14cf29bb68995f652f93a4f6e3cb55c8d7 (patch) | |
tree | 04fb972934969cb01a52f3b9b8af0a17134ef5b6 /cli/tools/lint.rs | |
parent | 0366d6833f25b786e897ce0d6393f692507f0532 (diff) |
feat: TypeScript 5.0.2 (except decorators) (#18294)
This upgrades TypeScript to 5.0.2, but does not have ES decorator
support because swc does not support that yet.
Diffstat (limited to 'cli/tools/lint.rs')
-rw-r--r-- | cli/tools/lint.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 4eebf9e16..821257570 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -35,6 +35,7 @@ use serde::Serialize; use std::fs; use std::io::stdin; use std::io::Read; +use std::path::Path; use std::path::PathBuf; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; @@ -245,12 +246,12 @@ pub fn create_linter( } fn lint_file( - file_path: &PathBuf, + file_path: &Path, source_code: String, lint_rules: Vec<&'static dyn LintRule>, ) -> Result<(Vec<LintDiagnostic>, String), AnyError> { let file_name = file_path.to_string_lossy().to_string(); - let media_type = MediaType::from(file_path); + let media_type = MediaType::from_path(file_path); let linter = create_linter(media_type, lint_rules); |