eslint / typescript-eslint-parser

An ESLint custom parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
Other
915 stars 92 forks source link

no-restricted-globals: false positive on class property #487

Closed burnnat closed 5 years ago

burnnat commented 6 years ago

What version of TypeScript are you using? 2.9.1

What version of typescript-eslint-parser are you using? 16.0.0

What code were you trying to parse? With no-restricted-globals rule enabled ("no-restricted-globals": [2, "status"]):

export default class Test {
    private status: string;

    getStatus() {
        return this.status;
    }
}

What did you expect to happen? Lint completes without error.

What happened? False positive for no-restricted-globals:

2:10  error  Unexpected use of 'status'  no-restricted-globals
burnnat commented 6 years ago

It appears this is also an issue with interface properties:

interface Test {
    status: string;
}
christophehurpeau commented 6 years ago

seems to be a duplicate of #414