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

Appearance settings

Bug: [no-misused-promises] async finally error #7276

Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
@ziimakc

Description

@ziimakc
Issue body actions

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.1.6&fileType=.tsx&code=IYZwngdgxgBAZgV2gFwJYHsLwgCgJQwDeAsAFAwzADuwqyMACgE7oC2qIApgHROcBWnKMhwBmPNzioIwADaywOUJFj4YAXgB8RAL54A3GR1A&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oFtLlZkiACa1i0Dr0GoMkRNHHRI4MAF8QKoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

async function fn() {
  await Promise.reject(3).finally(async () => {});
}

ESLint Config

module.exports = {
  parser: "@typescript-eslint/parser",
  rules: {
    "@typescript-eslint/no-misused-promises": "error"
  },
};

tsconfig

{
	"exclude": ["**/node_modules"],
	"compilerOptions": {
		"target": "ES2022",
		"useDefineForClassFields": true,
		"module": "ES2022",
		"moduleResolution": "node",
		"resolveJsonModule": true,
		"allowJs": true,
		"checkJs": true,
		"declaration": true,
		"declarationMap": true,
		"sourceMap": true,
		"removeComments": true,
		"importHelpers": true,
		"downlevelIteration": true,
		"newLine": "LF",
		"isolatedModules": true,
		"verbatimModuleSyntax": true,
		"allowSyntheticDefaultImports": true,
		"esModuleInterop": true,
		"forceConsistentCasingInFileNames": true,
		"strict": true,
		"noUnusedLocals": false,
		"noUnusedParameters": false,
		"exactOptionalPropertyTypes": true,
		"noImplicitReturns": true,
		"noFallthroughCasesInSwitch": true,
		"noUncheckedIndexedAccess": true,
		"noImplicitOverride": true,
		"noPropertyAccessFromIndexSignature": true,
		"allowUnusedLabels": false,
		"allowUnreachableCode": false,
		"skipLibCheck": true
	}
}

Expected Result

No error

Actual Result

Error:

Promise returned in function argument where a void return was expected

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.