mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Do not emit 'use strict' prologue in .json files with --alwaysStrict
This commit is contained in:
@@ -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