Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

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

Closed
burnnat opened this issue Jun 12, 2018 · 2 comments · Fixed by #540
Closed

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

burnnat opened this issue Jun 12, 2018 · 2 comments · Fixed by #540

Comments

@burnnat
Copy link

burnnat commented Jun 12, 2018

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
Copy link
Author

burnnat commented Jun 13, 2018

It appears this is also an issue with interface properties:

interface Test {
    status: string;
}

@christophehurpeau
Copy link

seems to be a duplicate of #414

mysticatea added a commit that referenced this issue Nov 8, 2018
mysticatea added a commit that referenced this issue Nov 13, 2018
* Update: add proper scope analysis (fixes #535)

* add computed-properties-in-type fixture

* add computed-properties-in-interface fixture

* add function-overload fixture

* add method-overload fixture

* add class-properties fixture

* add decorators fixture

* update visitor-keys

* add declare-global fixture

* fix typo

* add test for typeof in array destructuring

* add namespace fixture

* add declare-module fixture

* fix crash

* add declare-function.ts fixture

* add abstract-class fixture

* add typeof-in-call-signature fixture

* add test for #416

* add test for #435

* add test for #437

* add test for #443

* add test for #459

* add test for #466

* add test for #471

* add test for #487

* add test for #535

* add test for #536

* add test for #476

* fix test to use `expect()`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants