Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
{"rules":{'@typescript-eslint/no-unsafe-member-access':'error','@typescript-eslint/no-unsafe-call':'error',}}
publicgetObs$():Observable<number>{returnnewObservable<number>();}publicgetPopularDepartments():void{ this.getObs$.pipe().subscribe((res)=>{console.log(res);});}
Expected Result
publicgetPopularDepartments():void{ this.getObs$.pipe().subscribe((res)=>{~~~~~~~~~~~~~console.log(res);});}
Two separate warnings
Actual Result
publicgetPopularDepartments():void{ this.getObs$.pipe().subscribe((res)=>{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~console.log(res);});}
By appearances, a single error, with the true error hidden within
Additional Info
The plugin could probably do with a 'loc' property to be returned to define exactly where to show the warning/error. In some paths, the code finds the name of the offending method (subscribe) in this example. It might be a case of finding that string within the source and returning that as the loc property.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 3.0.2 |
@typescript-eslint/parser | 3.0.2 |
TypeScript | 3.8.3 |
ESLint | 7.1.0 |
node | 12.16.3 |
npm | 6.14.4 |