Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[no-unsafe-member-access] location of warning is swamping other warnings #2164

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@LakMoore

Description

@LakMoore
{"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

packageversion
@typescript-eslint/eslint-plugin3.0.2
@typescript-eslint/parser3.0.2
TypeScript3.8.3
ESLint7.1.0
node12.16.3
npm6.14.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp