There is another way to get rid of this error - change the tslint rules for the entire project .
In my case, I had an existing project with hundreds of lines exceeding the limit. In fact, the code was more understandable because it was basically an array of objects. But VS Code drew a red underline throughout the file, making it difficult to read.
I did the following: "max-line-length": [ false ] .
You can also change the length by writing "max-line-length": [ true, 240 ] , which will give the same result.
Here is an example of tslint.json that I have right now:
{ "extends": "../tslint.json", "rules": { "directive-selector": [ true, "attribute", "app", "camelCase" ], "component-selector": [ true, "element", "app", "kebab-case" ], "max-line-length": [ false ], } }
Also, check out this link for more options.
sr9yar
source share