Reputation: 6929
How to configure TSLint to show an error for the following code?
static readonly frame: 'frame';
The intention was to write:
static readonly frame = 'frame';
Upvotes: 0
Views: 216
Reputation: 9124
I am not aware of any rule who does this. You could write a custom one tho.
After all I want to recommend you not to use static readonly fields in a typescript class. Please consider using a const in the ts file instead
const frame = 'frame';
// compiler would show an error on const frame: 'frame'
export class YourClass {
// instead of static readonly frame = 'frame'
}
Upvotes: 0