Skip to content

Commit 9e42994

Browse files
committed
chore(eslint): Add eslint-plugin-rxjs
1 parent b21973a commit 9e42994

File tree

4 files changed

+277
-9
lines changed

4 files changed

+277
-9
lines changed

.eslintrc.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"extends": [
1919
"plugin:@angular-eslint/recommended",
20-
"plugin:@angular-eslint/template/process-inline-templates"
20+
"plugin:@angular-eslint/template/process-inline-templates",
21+
"plugin:rxjs/recommended"
2122
],
2223
"rules": {
2324
"@angular-eslint/component-selector": [
@@ -43,6 +44,29 @@
4344
"arrays": "always-multiline",
4445
"functions": "never"
4546
}
47+
],
48+
"rxjs/finnish": [
49+
"error",
50+
{
51+
"functions": true,
52+
"methods": true,
53+
"names": {
54+
"^(canActivate|canActivateChild|canDeactivate|canLoad|intercept|resolve|validate)$": false
55+
},
56+
"parameters": true,
57+
"properties": true,
58+
"strict": false,
59+
"types": {
60+
"^EventEmitter$": false
61+
},
62+
"variables": true
63+
}
64+
],
65+
"rxjs/no-implicit-any-catch": [
66+
"error",
67+
{
68+
"allowExplicitAny": true
69+
}
4670
]
4771
}
4872
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"@typescript-eslint/eslint-plugin": "4.28.2",
6666
"@typescript-eslint/parser": "4.28.2",
6767
"eslint": "^7.26.0",
68+
"eslint-plugin-rxjs": "^4.0.1",
6869
"jasmine-core": "~3.8.0",
6970
"karma": "~6.3.2",
7071
"karma-chrome-launcher": "~3.1.0",

src/test/services/pending-requests-interceptor.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('PendingRequestsInterceptor', () => {
8484

8585
http.get('/fake').subscribe({
8686
next: () => expect(true).toBe(false),
87-
error: (error: HttpErrorResponse) => expect(error.statusText).toBe(statusTextNotFound)
87+
error: (error: any) => expect(error.statusText).toBe(statusTextNotFound)
8888
});
8989

9090
const testRequest = httpMock.expectOne('/fake');

0 commit comments

Comments
 (0)