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

Bug: [no-misused-promises] Possible false positive in 5.27.0 #5121

Closed
Labels
fix: user errorissue was fixed by correcting the configuration / correcting the codepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended
@doberkofler

Description

@doberkofler

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=4.7.2&sourceType=module&code=C4TwDgpgBAJghsOAVc0C8UDeBXAzhAJwEsYAuKAO2wFsAjQgXwG4AoFgM2woGNgiB7CrARwA4hGAA1OABsSCCAAowcAnAD85AEoRu-AjAA8uYMQoBzADRQuAawr8A7hQB8UAD6VsMmQEpyAAoE-NRE+IZ2Ds5umCxQUAQS2ARCQSFhEAB0ibj8MgBuSipqvqwMbBAAHmD6wFBwuCA8UJw8fIJQ+DKKeIQk5FR0hP5QaaHh8IgokB5ePjFxUHoUJsKIUBhwjnBEdZNiEtJyk0o4+MQwDL71uKPB4xCG+9PQnlTzrPFE7FCK+1AAQjQGHefiwi3iiWAySEsXi8KgmSR+0sEKgzEW5UWUJhcxkZRYQA&eslintrc=N4KAkARApgHgLlAdgEwM4QFwAIDa5IAOANgK4DmAlohgAJwCeBUqAxgE4UFwC0zRVcAPR8B3NlBYB7ALbSkyKMggAafBGLkqtBk1YcuvVP0RCAhkSIQQWLAF1VNiGxJFmmLKBuO6jZu048IiaCiJLc0hSoJKiK3ARsMpFu2HheXtBsCWwq1mkeuXlYECwAFhIA1qgAapIUyABKUHAkbIjuAGbmMQVeAL49ttb9vUA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA

Repro Code

exportasyncfunctionsel(key:pkType):Promise<showProfileType|null>{constdata=awaitdataGetValidate('!LAS_MOD_User_JSON.getEmpl',{emplid:key.emplid})asPromise<showProfileType|null>;if(data!==null){return{...data,// eslint-disable-line @typescript-eslint/no-misused-promisesremoveimg:false,removesign:false,};}returnnull;}

ESLint Config

{"parser":"/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/@typescript-eslint/parser/dist/index.js","parserOptions":{"project":["./tsconfig.json","./test/selenium/tsconfig.json"]},"plugins":["@typescript-eslint"],"rules":{"@typescript-eslint/no-misused-promises":"error"}}

tsconfig

{"compilerOptions": {"allowJs":true,"checkJs":false,"skipLibCheck":true,"noEmit":true,"downlevelIteration":true,"sourceMap":true,"strict":true,"noImplicitAny":true,"strictNullChecks":true,"noImplicitThis":false,"noUnusedLocals":true,"noUnusedParameters":false,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"noUncheckedIndexedAccess":false,"useUnknownInCatchVariables":true,"exactOptionalPropertyTypes":false,"esModuleInterop":true,"declaration":false,"importHelpers":true,"moduleResolution":"node","target":"es2017","module":"esnext","jsx":"react","baseUrl":"../","outDir":"../temp","removeComments":true,"lib": ["dom"    ],"paths": {"@alias_root/*": ["./*"      ]    }  },"compileOnSave":false,"include": ["src/**/*","test/unittest/**/*"  ],"exclude": ["node_modules"  ]}

Expected Result

I would not expect the warning (this still worked in version 5.26.0)

Actual Result

The warningExpected a non-Promise value to be spreaded in an object @typescript-eslint/no-misused-promises in shown since the upgrade to version 5.27.0

Additional Info

Unfortunately, I was not able to reproduce the error in the playground

Versions

packageversion
@typescript-eslint/eslint-plugin5.27.0
@typescript-eslint/parser5.27.0
TypeScript4.7.2
ESLint8.16.0
node18.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    fix: user errorissue was fixed by correcting the configuration / correcting the codepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking 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


      [8]ページ先頭

      ©2009-2025 Movatter.jp