1
votes

TL;DR: Is there a way to turn off all TSLint rules that have to do with code style/readability? Barring that, is there a way to turn off all TSLint rules that don't pertain to whether my code will compile properly?

Details: I'm using the WebStorm IDE for an Angular project, and it uses TSLint. I like TSLint's real-time warnings/errors, as I am fairly new to JavaScript and the instant feedback streamlines my learning process.

However, I don't like how TSLint gives me warnings about style/formatting. For example, if I don't put a space between two things or if I have a curly brace on a line by itself. I want warnings to tell me about problems with my actual code, rather than someone's opinions about how my code should look. I respect that they must be valuable to some people - I'm just not one of them.

On the official TSLint site's rules page, it lists the rules I want to remove under a single category called "Style". While I've found various posts about how to turn off individual rules like "whitespace", I haven't been able to dig up anything about how to disable this entire category of rules...and I'm hoping it exists, because there are a lot of rules.

Is there any way to do this without disabling every rule individually?

2

2 Answers

3
votes

According to the TSLint developers, TSLint has no rules active by default, so there should be no need to turn them off. I mistakenly thought that TSLint had default rules, when in fact the actual problem was that someone else had put a tslint.json file in a directory I did not expect to find it in. Relocating this file to a more appropriate place fixed the problem.

2
votes

Such a thing does not exist. You can try filing an issue on https://github.com/palantir/tslint.

Have you tried manually disabling rules in your tslint.json?