Skip to content

Commit

Permalink
feat: support modern ECMAScript libs and targets (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac authored Sep 19, 2024
1 parent e2f5b2b commit e33c86b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ pub struct CompilerOptions {
#[derive(Deserialize, Debug, PartialEq, Copy, Clone, Default)]
#[serde(rename_all = "lowercase")]
pub enum ModuleDetectionMode {
#[default]
Auto,
Legacy,
Force,
#[default]
Auto,
Legacy,
Force,
}

/// Module resolution mode
Expand Down Expand Up @@ -581,6 +581,9 @@ pub enum Target {
Es2018,
Es2019,
Es2020,
Es2021,
Es2022,
Es2023,
EsNext,
Other(String),
}
Expand All @@ -602,6 +605,9 @@ impl<'de> Deserialize<'de> for Target {
"ES2018" => Target::Es2018,
"ES2019" => Target::Es2019,
"ES2020" => Target::Es2020,
"ES2021" => Target::Es2021,
"ES2022" => Target::Es2022,
"ES2023" => Target::Es2023,
"ESNEXT" => Target::EsNext,
other => Target::Other(other.to_string()),
};
Expand Down Expand Up @@ -631,6 +637,9 @@ pub enum Lib {
Es2018,
Es2019,
Es2020,
Es2021,
Es2022,
Es2023,
EsNext,
Dom,
WebWorker,
Expand Down Expand Up @@ -684,6 +693,9 @@ impl<'de> Deserialize<'de> for Lib {
"ES2018" => Lib::Es2018,
"ES2019" => Lib::Es2019,
"ES2020" => Lib::Es2020,
"ES2021" => Lib::Es2021,
"ES2022" => Lib::Es2022,
"ES2023" => Lib::Es2023,
"ESNext" => Lib::EsNext,
"DOM" => Lib::Dom,
"WEBWORKER" => Lib::WebWorker,
Expand Down

0 comments on commit e33c86b

Please sign in to comment.