Closed
Description
The ES6 spec for classes doesn't include properties making the code below valid JavaScript (and invalid TypeScript) code
class Cat {
constructor(name) {
this.name = name;
}
speak() {
console.log(this.name + ' makes a noise.');
}
}
When feeding code like this into the TypeScript compiler you get an error about this.name
not being defined. TypeScript should be able to detect that this is a JavaScript class (*.js,*.jsx
-files) and (1) not mark the property access this.name
as error and (2) offer tooling support for the data property (IntelliSense et al)