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

[@typescript-eslint/no-misused-promises] Regression - false positive for mocha 'it' functions in version 5.13.0? #4640

Closed
Labels
duplicateThis issue or pull request already existspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@gboer

Description

@gboer
  • [ x ] I have tried restarting my IDE and the issue persists.
  • [ x ] I have updated to the latest version of the packages.
  • [ x ] I haveread the FAQ and my problem is not listed.

Repro

{"rules": {"@typescript-eslint/no-misused-promises": ["error"]  }}
import{expect}from'chai';describe('An example',()=>{it('can be an example!',async()=>{expect(awaitPromise.resolve(true)).to.equal(true);});});

tsconfig.json:

{  "compilerOptions": {    "lib": [      "ES2021"    ],    "module": "CommonJS",    "moduleResolution": "node"  },  "include": [    "**/*.ts"  ]}

Expected Result

I expect the rule to not throw errors for the 'it' functions of Chai, since it has(this: Context) => PromiseLike<any> as its signature. No error is thrown for version 5.12.1 and earlier, of @typescript-eslint/eslint-plugin + parser.

Actual Result

<my path>/test.ts  4:28  error  Promise returned in function argument where a void return was expected  @typescript-eslint/no-misused-promises✖ 1 problem (1 error, 0 warnings)

Versions

packageversion
@typescript-eslint/eslint-plugin5.13.0
@typescript-eslint/parser5.13.0
TypeScript4.5.5
ESLint8.10.0
node16.13.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existspackage: 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