Skip to content

JS: properties on class and function declarations are not type checked #16239

Closed
@OliverJAsh

Description

@OliverJAsh

TypeScript Version: 2.3.4

Code

class Foo {}
Foo.bar = 1; // expected error, but got none

const Foo2 = () => {};
Foo2.bar = 1; // error

function FooBar() {}
FooBar.bar = 1; // expected error, but got none

This errors is TS files, but not in JS files where checkJs is enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions