TypeStrict
Squash bugs before shipping them with TypeScript and TSLint!
TSLint config focused on maximizing type safety
Installation
npm install --save-dev typestrict
or
yarn add --dev typestrict
Usage
Create tslint.json
:
{
"extends": "typestrict"
// ... add here your own rules
}
and run tslint -c ./tslint.json --project ./tsconfig.json --format stylish
.
Remember to use strict
compiler setting in tsconfig.json
!
Please, for now ignore warning about deprecated rule, it's discussed here
Description
All rules in this config are focused on catching bugs in your code and be as not annoying as possible. They don't care about code style or formatting.
TypeStrict
combines rules from various rule sets: tslint,
sonarTS,
tslint-microsoft-contrib.
Complete rules list
TSLint
- await-promise
- no-floating-promises
- no-unused-variable (with
"check-parameters"
and{"ignore-pattern": "^_" }
) - no-use-before-declare
- no-duplicate-super
- no-inferred-empty-object-type
- no-invalid-this
- no-misused-new
- restrict-plus-operands
- use-isnan
SonarTS
- no-accessor-field-mismatch
- no-all-duplicated-branches
- no-collection-size-mischeck
- no-dead-store
- no-duplicated-branches
- no-element-overwrite
- no-empty-destructuring
- no-gratuitous-expressions
- no-identical-conditions
- no-identical-expressions
- no-ignored-return
- no-multiline-string-literals
- no-self-assignment
- no-unconditional-jump
- no-unthrown-error
- no-unused-array
- no-useless-cast
- no-useless-increment
- no-variable-usage-before-declaration
Microsoft Contrib
Contributing
Do you have idea for new rule to be added? You don't agree with one of rules included? Feel free to create issue / PR.
License
MIT by Krzysztof Kaczor