-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
{
"rules": {
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
}
}
public getObs$(): Observable<number> {
return new Observable<number>();
}
public getPopularDepartments(): void {
this.getObs$.pipe().subscribe((res) => {
console.log(res);
});
}
Expected Result
public getPopularDepartments(): void {
this.getObs$.pipe().subscribe((res) => {
~~~~ ~~~~~~~~~
console.log(res);
});
}
Two separate warnings
Actual Result
public getPopularDepartments(): 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 |
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin