mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Do not emit 'use strict' prologue in .json files with --alwaysStrict
This commit is contained in:
1 parent
576a733378
commit
7ef7f907b9
5 files changed
+137
-1
No files matched your search
@@ -552,7 +552,9 @@ namespace ts {
|
||||
|
||||
function visitSourceFile(node: SourceFile) {
|
||||
const alwaysStrict = getStrictOptionValue(compilerOptions, "alwaysStrict") &&
|
||||
!(isExternalModule(node) && moduleKind >= ModuleKind.ES2015);
|
||||
!(isExternalModule(node) && moduleKind >= ModuleKind.ES2015) &&
|
||||
!isJsonSourceFile(node);
|
||||
|
||||
return updateSourceFileNode(
|
||||
node,
|
||||
visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));
|
||||
|
||||
Reference in new issue
Block a user