The TSLint.json config file (https://github.com/palantir/tslint) supports extends and a rulesDirectory array like so
{
"extends": [
"tslint-microsoft-contrib",
"tslint-config-security"
],
"rulesDirectory": [
"node_modules/tslint-eslint-rules/dist/rules",
"node_modules/tslint-microsoft-contrib",
"node_modules/tslint-config-security"
]
}
The docs seem slightly open to interpretation for new users unfamiliar to the tool.
I would appreciate if anyone could clarify a few points on the behaviour of extends and rulesDirectory in relation to use in the VS Code editor and tslinting in general.
Does
extendsonly provide a default configuration (if provided by package)?and is this therefore different to
rulesDirectory?Does
rulesDirectoryonly provide rules for you to specifically opt-in(and is required if specifying rules in the root tslint.json)?Should I still specify the
tslintpackages in bothextendsandrulesDirectory?
Assuming
extendsprovides defaults from anothertslintconfig file, would I be able to specify therulesDirectoryand add a rule to override a specific flag?
Concerned because only some of the rules show up in IntelliSense autocompletion and just a few behaviours that I would appreciate more clarity for.
extendsconfiguration option extends thetslint.jsonconfiguration in the named package and makes available the rules in the named package. Whether or not the package'stslint.jsonenables any of its rules be default is a decision for the package author. I have several TSLint packages that provide default configurations that have no rules enabled, so usingextendsimply makes the packages' rules available in a more concise manner than specifying paths to the packages' rules directories. - cartantrulesDirectory? Also, Does your IDE autocomplete work for your packages' rules when adding them in? I see your work onTSLintingRxJS. I wish I had noticed that earlier when I was trying to sort out differentRxJSversions while learning! I would happily accept your answer for this question - mittens pair