Friday 22 February 2019

no-unused-variable TSLint rule does not work with private @HostBinding

In my TSLint file, I have:

"no-unused-variable": true

In my components, I sometimes have:

// tslint:disable-next-line:no-unused-variable
@HostBinding('class') private classes = 'my-theme';

Because classes is private, TSLint complains, so I have to disable TSLint everytime.

I do not want to make @HostBinding public because of encapsulation.

What is the recommended way to solve this problem?



from no-unused-variable TSLint rule does not work with private @HostBinding

No comments:

Post a Comment