npm install --save-dev tslint tslint-config-m18
In tslint.json
:
{
"extends": "tslint-config-m18"
}
To use with type-check rules, in tslint-type-check.json
:
{
"extends": ["tslint-config-m18", "tslint-config-m18/typeCheck"]
}
And run with:
tslint -c tslint-type-check.json -p \"scripts/tsconfig.json\" --type-check
Example scripts for package.json
:
{
"scripts": {
"lint:scripts-project": "tslint -c tslint-type-check.json -p tsconfig.json --type-check",
"lint:scripts-other": "tslint \"{*.js,src/*.d.ts,test/*.{ts,tsx}}\"",
"lint": "npm run lint:scripts-project && npm run lint:scripts-other"
}
}
MIT.