mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 12:58:54 -05:00
fix(cli): re-enable allowSyntheticDefaultImports for tsc (#12435)
Fixes #12434
This commit is contained in:
parent
86f7bf89c5
commit
34418884f4
2 changed files with 27 additions and 0 deletions
|
@ -149,6 +149,7 @@ pub(crate) fn get_ts_config(
|
|||
ConfigType::Check { tsc_emit, lib } => {
|
||||
let mut ts_config = TsConfig::new(json!({
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
"incremental": true,
|
||||
"jsx": "react",
|
||||
|
@ -193,6 +194,7 @@ pub(crate) fn get_ts_config(
|
|||
ConfigType::RuntimeEmit { tsc_emit } => {
|
||||
let mut ts_config = TsConfig::new(json!({
|
||||
"allowJs": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"checkJs": false,
|
||||
"emitDecoratorMetadata": false,
|
||||
"experimentalDecorators": true,
|
||||
|
|
25
cli/tests/testdata/compiler_api_test.ts
vendored
25
cli/tests/testdata/compiler_api_test.ts
vendored
|
@ -177,6 +177,31 @@ Deno.test({
|
|||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "Deno.emit() - allowSyntheticDefaultImports true by default",
|
||||
async fn() {
|
||||
const { diagnostics, files, ignoredOptions } = await Deno.emit(
|
||||
"file:///a.ts",
|
||||
{
|
||||
sources: {
|
||||
"file:///a.ts": `import b from "./b.js";\n`,
|
||||
"file:///b.js":
|
||||
`/// <reference types="./b.d.ts";\n\nconst b = "b";\n\nexport default b;\n`,
|
||||
"file:///b.d.ts": `declare const b: "b";\nexport = b;\n`,
|
||||
},
|
||||
},
|
||||
);
|
||||
assertEquals(diagnostics.length, 0);
|
||||
assert(!ignoredOptions);
|
||||
const keys = Object.keys(files).sort();
|
||||
assertEquals(keys, [
|
||||
"file:///a.ts.js",
|
||||
"file:///a.ts.js.map",
|
||||
"file:///b.js",
|
||||
]);
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "Deno.emit() - no check",
|
||||
async fn() {
|
||||
|
|
Loading…
Reference in a new issue