tslint-microsoft-contrib






A set of TSLint rules used on some Microsoft projects.
Notice
This project is in read-only and archive mode.
Installation
npm install tslint-microsoft-contrib --save-dev
TSLint and corresponding tslint-microsoft-contrib version
TSLint version |
tslint-microsoft-contrib version |
>= 5.x |
5.x and 6.x (supporting TypeScript 2.3.x, >=2.4, 3.x) |
>= 4.x |
4.x (supporting TypeScript 2.1.x) |
>= 3.2.x |
2.x |
3.1.x |
unsupported |
3.0.x |
unsupported |
2.x |
1.x |
Configuration
Add "node_modules/tslint-microsoft-contrib"
under your "rulesDirectory"
configuration to inform TSLint it should look under this package for additional rules in your tslint.json
:
{
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
"rules": {
// ...
}
}
Which Rules Should I Turn On?
There certainly are a lot of options!
If you extend from one of the following configurations, rulesDirectory
will have node_modules/tslint-microsoft-contrib
included for you.
Please note, some of the default ruleset rules require the --project
TSLint option.
Recommended
To start, you can enable our stable "recommended" defaults that come with tslint-microsoft-contrib (recommended.json) by adding "tslint-microsoft-contrib/recommended"
under "extends"
in your tslint.json
:
{
"extends": ["tslint-microsoft-contrib/recommended"]
// ...
}
These rules will not be added to in minor or patch releases, but will be in major releases.
Latest
To run with the latest and greatest rules (latest.json), extend from tslint-microsoft-contrib/latest
:
{
"extends": ["tslint-microsoft-contrib/latest"]
// ...
}
These rules will not be added to in patch releases, but will be in minor releases.
Legacy
The old "recommended" ruleset that ships by extending tslint-microsoft-contrib
itself contains a list of rules that includes core TSLint rules.
To start, you can enable our recommended defaults (recommended.json) by adding just "tslint-microsoft-contrib"
under "extends"
in your tslint.json
:
{
"extends": ["tslint-microsoft-contrib"]
// ...
}
This ruleset is considered legacy; it is generally preferable to extend from the 'recommended' or 'latest' rulesets.
We recommend you instead explicitly include tslint:recommended
, tslint:latest
, or tslint:all
in your tslint.json
rather than enable core rules through this configuration.
In the next major version of TSLint, this will instead be an alias for "tslint-microsoft-contrib/recommended"
.
Overriding Configurations
You can disable rules you don't find useful.
If you rely on version ranges in your dependencies then you may find that new rules being added to the product create violations and fail your build.
We recommend you specify exact versions of lint libraries, including tslint-microsoft-contrib
, in your package.json
.
Supported Rules
Development
See CONTRIBUTING.md.
Release notes
Check GitHub Releases for individual release notes or CHANGELOG.md for full project changelog.