Skip to content

Commit

Permalink
Merge pull request #9 from DonIsaac/master
Browse files Browse the repository at this point in the history
feat: add isolatedDeclarations to compilerOptions
  • Loading branch information
drivasperez authored Sep 19, 2024
2 parents b1bb899 + e33c86b commit 9b964d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ pub struct CompilerOptions {
pub import_helpers: Option<bool>,
pub incremental: Option<bool>,
pub isolated_modules: Option<bool>,
pub isolated_declarations: Option<bool>,
pub jsx: Option<Jsx>,
pub lib: Option<Vec<Lib>>,
pub module: Option<Module>,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -580,6 +581,9 @@ pub enum Target {
Es2018,
Es2019,
Es2020,
Es2021,
Es2022,
Es2023,
EsNext,
Other(String),
}
Expand All @@ -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()),
};
Expand Down Expand Up @@ -630,6 +637,9 @@ pub enum Lib {
Es2018,
Es2019,
Es2020,
Es2021,
Es2022,
Es2023,
EsNext,
Dom,
WebWorker,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */,
Expand Down

0 comments on commit 9b964d5

Please sign in to comment.