mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 13:38:33 +03:00
refactor(es/parser): Remove import_assertions
from TsConfig
(#2950)
This commit is contained in:
parent
74363e0357
commit
97df4cef80
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -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,
|
||||||
|
@ -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
|
||||||
},
|
},
|
||||||
|
@ -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,
|
||||||
|
@ -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)]
|
||||||
|
@ -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()
|
||||||
}),
|
}),
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -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()
|
||||||
}),
|
}),
|
||||||
|
@ -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(),
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user