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-unnecessary-type-assertion] false positive on uninitialized variables #453

Closed
Labels
bugSomething isn't workinghas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@mysticatea

Description

@mysticatea

Repro

{"rules": {"@typescript-eslint/no-unnecessary-type-assertion":"error"  }}
functiontest(){letresolve:()=>voidnewPromise(resolve0=>{resolve=resolve0})returnresolve!}

Expected Result

No errors because it's a syntax error if I removed the!.

Actual Result

6:12  error  This assertion is unnecessary since it does not change the type of the expression  @typescript-eslint/no-unnecessary-type-assertion

Additional Info

Versions

packageversion
@typescript-eslint/eslint-plugin1.7.0
@typescript-eslint/parser1.7.0
TypeScript3.4.3
ESLint5.16.0
node10.15.3
npm6.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas prthere is a PR raised to close thispackage: 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