False-Positive: SonarLint: Refactor this redundant 'await' on a non-promise

Hi there :slight_smile: ,
I am a bit confused because I still seeing almost 99% of false-positive with:

  • Plugin: SonarLint version: 5.3.0.36775

  • IDE: IntelliJ IDEA 2021.2.2 (Ultimate Edition) Build #IU-212.5284.40, built on September 14, 2021

I’ve found many places where Elena Vilchik seems to have found and fixed this wrong behavior.
But I personally still having that issue not solved.

Found here the snippet to reproduce:

const aSimpleAsyncFunctionWithPromise = () => Promise.resolve('done');
const aSimpleAsyncFunctionWithOutPromise = async () => aSimpleAsyncFunctionWithPromise();

async function main() {
  // Don't show any warning :)
  console.info(await aSimpleAsyncFunctionWithPromise());
  // Shows: SonarLint: Refactor this redundant 'await' on a non-promise. 
  console.info(await aSimpleAsyncFunctionWithOutPromise());
}

main();

Am I doing something wrong or misconfigured something?
I would appreciate all the help to understand what is happening here.

Thanks in advance for your support.
Best regards,
Vincent

Hey,

Please try to upgrade the SonarLint, I can’t reproduce on latest SonarLint (6.2) while I could with 5.x