A set of TSLint rules for jasmine
TSLint will be discontinued in 2020 - the "official" replacement is ESLint. If you want Jasmine Lint Checks in ESLint, check out eslint-plugin-jasmine
npm install tslint-jasmine
Add "node_modules/tslint-jasmine"
under your "rulesDirectory"
configuration in tslint.json
:
{
"rulesDirectory": [
"node_modules/tslint-jasmine"
],
"rules": {
"no-jasmine-focus": true,
"no-jasmine-exclude": true,
"no-jasmine-pending": true
}
}
Rule | What does it do | Since |
---|---|---|
no-jasmine-focus | Throws lint error if fdescribe or fit is used somewhere |
1.0 |
no-jasmine-exclude | Throws lint error if xdescribe or xit is used somewhere |
1.0 |
no-jasmine-pending | Throws lint error if pending is used somewhere |
1.0 |
In case you want to use all the rules, you can simply extend the ruleset, instead of defining all rules:
{
"extends": [
"tslint-jasmine/all"
],
"rulesDirectory": [
"node_modules/tslint-jasmine"
]
}
- Bugfix: rules should only check jasmine functions (#1)
- Readme fixes
- Initial release with
no-jasmine-focus
,no-jasmine-exclude
andno-jasmine-pending
rules andall
ruleset