You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
In TypeScript, we can make use of the public or private keywords to skip having to manually assign the constructor param to the instance, so it becomes:
class MyClass {
constructor( public foo ) {}
bar() {
return this.foo
}
}
Currently the second version will erroneously produce a no-unused-vars error for foo because, as far as eslint is concerned, it is not used in the constructor
The text was updated successfully, but these errors were encountered:
(Note: I am using ESLint via eslint-loader for webpack)
ESLint: 1.9.0
eslint-loader: 1.1.1
typescript-eslint-parser: 0.1.0-alpha-1
Take this valid ES2015 code:
In TypeScript, we can make use of the
public
orprivate
keywords to skip having to manually assign the constructor param to the instance, so it becomes:Currently the second version will erroneously produce a
no-unused-vars
error forfoo
because, as far as eslint is concerned, it is not used in the constructorThe text was updated successfully, but these errors were encountered: