Skip to content

Allow to run TypeScript (Compiler, Services) in strict mode #9449

Closed
@kpreisser

Description

@kpreisser

TypeScript Version: master

Currently, tsc.js, typescriptServices.js and tsserver.js cannot be run in a strict mode environment due to using the identifier static in checker.ts.

static is a reserved identifier in strict mode, so if you run tsc.js with Node in strict mode, it will fail:

C:\Users\VPC\Desktop\TypeScriptOrg\built\local>node --use_strict tsc.js
C:\Users\VPC\Desktop\TypeScriptOrg\built\local\tsc.js:24019
                    var static = ts.forEach(member.modifiers, function (m) { return m.kind === 113; });
                        ^^^^^^
SyntaxError: Unexpected strict mode reserved word

I think it is reasonable to allow TypeScript to be run in a strict mode environment, by changing the name of the variable.

PS: Is there a reason why the TypeScript sources don't use strict mode in general?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions