refactor(es/parser): Remove import_assertions from TsConfig (#2950)

This commit is contained in:
David Sherret 2021-12-05 00:43:41 -05:00 committed by GitHub
parent 74363e0357
commit 97df4cef80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2 additions and 17 deletions

View File

@ -1503,7 +1503,6 @@ impl Merge for swc_ecma_parser::TsConfig {
self.tsx |= from.tsx; self.tsx |= from.tsx;
self.decorators |= from.decorators; self.decorators |= from.decorators;
self.dynamic_import |= from.dynamic_import; self.dynamic_import |= from.dynamic_import;
self.import_assertions |= from.import_assertions;
} }
} }

View File

@ -3,8 +3,7 @@
"parser": { "parser": {
"syntax": "typescript", "syntax": "typescript",
"dynamicImport": true, "dynamicImport": true,
"decorators": true, "decorators": true
"importAssertions": true
}, },
"transform": { "transform": {
"legacyDecorator": true, "legacyDecorator": true,

View File

@ -135,7 +135,6 @@ fn shopify_2_same_opt() {
dynamic_import: true, dynamic_import: true,
dts: false, dts: false,
no_early_errors: false, no_early_errors: false,
import_assertions: false,
})), })),
transform: None, transform: None,
external_helpers: false, external_helpers: false,

View File

@ -123,7 +123,6 @@ fn compile(input: &Path, output: &Path, opts: Options) {
dynamic_import: true, dynamic_import: true,
dts: false, dts: false,
no_early_errors: true, no_early_errors: true,
import_assertions: false,
})), })),
..opts.config.jsc ..opts.config.jsc
}, },

View File

@ -231,7 +231,6 @@ mod tests {
dynamic_import: true, dynamic_import: true,
decorators: true, decorators: true,
no_early_errors: true, no_early_errors: true,
import_assertions: true,
..Default::default() ..Default::default()
}), }),
EsVersion::Es2015, EsVersion::Es2015,

View File

@ -148,10 +148,8 @@ impl Syntax {
match self { match self {
Syntax::Es(EsConfig { Syntax::Es(EsConfig {
import_assertions, .. import_assertions, ..
})
| Syntax::Typescript(TsConfig {
import_assertions, ..
}) => import_assertions, }) => import_assertions,
Syntax::Typescript(_) => true,
} }
} }
@ -314,10 +312,6 @@ pub struct TsConfig {
#[serde(skip, default)] #[serde(skip, default)]
pub no_early_errors: bool, pub no_early_errors: bool,
/// Stage 3.
#[serde(default)]
pub import_assertions: bool,
} }
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)]

View File

@ -47,7 +47,6 @@ fn test(input: PathBuf) {
decorators: true, decorators: true,
dynamic_import: true, dynamic_import: true,
no_early_errors: true, no_early_errors: true,
import_assertions: true,
..Default::default() ..Default::default()
}), }),
_ => { _ => {

View File

@ -220,7 +220,6 @@ where
tsx: fname.contains("tsx"), tsx: fname.contains("tsx"),
dynamic_import: true, dynamic_import: true,
decorators: true, decorators: true,
import_assertions: true,
no_early_errors, no_early_errors,
..Default::default() ..Default::default()
}), }),

View File

@ -20,7 +20,6 @@ fn no_empty(input: PathBuf) {
decorators: true, decorators: true,
dynamic_import: true, dynamic_import: true,
no_early_errors: true, no_early_errors: true,
import_assertions: true,
..Default::default() ..Default::default()
}), }),
EsVersion::latest(), EsVersion::latest(),

View File

@ -98,7 +98,6 @@ fn identity(entry: PathBuf) {
dynamic_import: true, dynamic_import: true,
dts: false, dts: false,
no_early_errors: false, no_early_errors: false,
import_assertions: true,
}), }),
(&*src).into(), (&*src).into(),
None, None,