Skip to content

Valid ES6 allowJs error TS8014: 'property declarations' can only be used in a .ts file. #7216

Closed
@dave-hillier

Description

@dave-hillier

TypeScript Version:

1.8.2

Code

// A self-contained demonstration of the problem follows...
class Repro
{
    static property = {
    foo: "bar"
    };
}

tsc --allowJs --out out.js repro.js

Expected behavior:

Compiles without error

Actual behavior:

repro.js(3,5): error TS8014: 'property declarations' can only be used in a .ts file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions