Reputation: 145
I'm trying to disable TSlint (Version: typescript 3.5.2, tslint 5.18.0) for a block of code in a VueJS project but it doesn't seems to work (it still displays errors and warning for this block at compilation with npm run serve)
I've already tried to use commented tslint:disable and eslint-disable without success.
Thanks for your help
Upvotes: 7
Views: 8006
Reputation: 655
You can also disable a specific rule for a block of code like that:
// tslint:disable:max-line-length
...your code here
// tslint:enable:max-line-length
Upvotes: 3
Reputation: 4251
Recently I have faced same issue in my Angular project below is how I solved my problem.
// tslint:disable
(event.keyCode >= A && event.keyCode <= Z) ||
(event.keyCode >= ZERO && event.keyCode <= NINE) ||
event.keyCode === SPACE ||
(this.preventHomeEndKeyPropagation &&
(event.keyCode === HOME || event.keyCode === END))
// tslint:enable
Upvotes: 8
Reputation: 874
The one way left:
use // @ts-ignore
over every line you want to skip checking (i hope the block is not too large)
Upvotes: 3