mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
useDefineForClassFields affects emit (#36308)
* useDefineForClassFields affects emit * fix lint
This commit is contained in:
committed by
Sheetal Nandi
parent
4445e1147c
commit
2dd21a08f5
@@ -968,6 +968,7 @@ namespace ts {
|
||||
name: "useDefineForClassFields",
|
||||
type: "boolean",
|
||||
affectsSemanticDiagnostics: true,
|
||||
affectsEmit: true,
|
||||
category: Diagnostics.Advanced_Options,
|
||||
description: Diagnostics.Emit_class_fields_with_Define_instead_of_Set,
|
||||
},
|
||||
|
||||
@@ -1121,6 +1121,31 @@ foo().hello`
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "updates diagnostics and emit when useDefineForClassFields changes",
|
||||
commandLineArgs: ["-w"],
|
||||
sys: () => {
|
||||
const aFile: File = {
|
||||
path: `/a.ts`,
|
||||
content: `class C { get prop() { return 1; } }
|
||||
class D extends C { prop = 1; }`
|
||||
};
|
||||
const config: File = {
|
||||
path: `/tsconfig.json`,
|
||||
content: JSON.stringify({ compilerOptions: { target: "es6" } })
|
||||
};
|
||||
return createWatchedSystem([aFile, config, libFile]);
|
||||
},
|
||||
changes: [
|
||||
sys => {
|
||||
sys.writeFile(`/tsconfig.json`, JSON.stringify({ compilerOptions: { target: "es6", useDefineForClassFields: true } }));
|
||||
sys.runQueuedTimeoutCallbacks();
|
||||
return "Enable useDefineForClassFields";
|
||||
},
|
||||
]
|
||||
});
|
||||
|
||||
verifyTscWatch({
|
||||
scenario,
|
||||
subScenario: "updates errors and emit when importsNotUsedAsValues changes",
|
||||
|
||||
Reference in New Issue
Block a user