Microsoft/TypeScript

No error for undeclared #private property in `.js` files

オープン

#35,962 opened on 2020/01/02

 (7 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
BugDomain: JavaScriptEffort: ModerateHelp Wanted

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

class Thing {
    /**
     * @param prop {string}
     */
    constructor(prop) {
        this.#prop = prop;
    }
}

This class assigns to #prop, but it's an error to use #prop without declaring it.

This is reported as a SyntaxError, so this should report an error even outside of checkJs.

コントリビューターガイド