Skip to content

Commit

Permalink
feat: add rules for rxjs 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nikulin-anton authored and YuliaTsareva committed Oct 11, 2019
1 parent d368e6c commit 1d4ecbe
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 36 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -36,7 +36,8 @@ Example of `tslint.json` file in your project:
{
"extends": [
"@tinkoff/linters/tslint/bases/prettier.tslint.json",
"@tinkoff/linters/tslint/mixins/rxjs5.5.tslint.json"
"@tinkoff/linters/tslint/mixins/rxjs5.5.tslint.json", // For RxJs 5.5
"@tinkoff/linters/tslint/mixins/rxjs6.tslint.json" // For RxJS 6+
]
}
```
Expand Down
24 changes: 24 additions & 0 deletions tslint/mixins/rxjs.common.tslint.json
@@ -0,0 +1,24 @@
{
"rulesDirectory": ["rxjs-tslint"],
"extends": ["rxjs-tslint-rules"],
"rules": {
"rxjs-collapse-imports": true,
"rxjs-pipeable-operators-only": true,
"rxjs-no-static-observable-methods": true,
"rxjs-no-unsafe-catch": true,
"rxjs-no-unsafe-switchmap": true,
"rxjs-no-subject-unsubscribe": true,
"rxjs-finnish": {
"options": [
{
"functions": false,
"methods": false,
"parameters": true,
"properties": true,
"variables": true
}
],
"severity": "error"
}
}
}
51 changes: 16 additions & 35 deletions tslint/mixins/rxjs5.5.tslint.json
@@ -1,37 +1,18 @@
{
"rulesDirectory": ["rxjs-tslint"],
"extends": ["rxjs-tslint-rules"],
"rules": {
"rxjs-collapse-imports": true,
"rxjs-pipeable-operators-only": true,
"rxjs-no-static-observable-methods": true,
"rxjs-no-add": {"severity": "error"},
"rxjs-no-operator": {"severity": "error"},
"rxjs-no-patched": {
"options": [
{
"allowObservables": false,
"allowOperators": false
}
],
"severity": "error"
},
"rxjs-no-wholesale": {"severity": "error"},
"rxjs-no-unsafe-catch": true,
"rxjs-no-unsafe-switchmap": true,
"rxjs-no-subject-unsubscribe": true,
"rxjs-no-deep-operators": true,
"rxjs-finnish": {
"options": [
{
"functions": false,
"methods": false,
"parameters": true,
"properties": true,
"variables": true
}
],
"severity": "error"
}
}
"extends": ["./rxjs.common.tslint.json"],
"rules": {
"rxjs-no-wholesale": {"severity": "error"},
"rxjs-no-add": {"severity": "error"},
"rxjs-no-operator": {"severity": "error"},
"rxjs-no-patched": {
"options": [
{
"allowObservables": false,
"allowOperators": false
}
],
"severity": "error"
},
"rxjs-no-deep-operators": true
}
}
6 changes: 6 additions & 0 deletions tslint/mixins/rxjs6.tslint.json
@@ -0,0 +1,6 @@
{
"extends": ["./rxjs.common.tslint.json"],
"rules": {
"rxjs-proper-imports": true
}
}

0 comments on commit 1d4ecbe

Please sign in to comment.