diff --git a/Cargo.lock b/Cargo.lock index 781cc9c..2db678a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,7 +134,7 @@ dependencies = [ [[package]] name = "tsconfig" -version = "0.2.1" +version = "0.3.1" dependencies = [ "json_comments", "regex", diff --git a/src/lib.rs b/src/lib.rs index 5e31fb5..5cc99c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -364,6 +364,7 @@ pub struct CompilerOptions { pub import_helpers: Option, pub incremental: Option, pub isolated_modules: Option, + pub isolated_declarations: Option, pub jsx: Option, pub lib: Option>, pub module: Option, @@ -471,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 @@ -580,6 +581,9 @@ pub enum Target { Es2018, Es2019, Es2020, + Es2021, + Es2022, + Es2023, EsNext, Other(String), } @@ -601,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()), }; @@ -630,6 +637,9 @@ pub enum Lib { Es2018, Es2019, Es2020, + Es2021, + Es2022, + Es2023, EsNext, Dom, WebWorker, @@ -683,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, diff --git a/test/tsconfig.common.json b/test/tsconfig.common.json index ba77469..a61aec2 100644 --- a/test/tsconfig.common.json +++ b/test/tsconfig.common.json @@ -17,6 +17,7 @@ "importHelpers": true /* Import emit helpers from 'tslib'. */, "downlevelIteration": true /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */, "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */, + "isolatedDeclarations": true, /* Strict Type-Checking Options */ "strict": true /* Enable all strict type-checking options. */,