S4123 False positive?

  • versions used: sonarlint / sonarcloud
  • minimal code sample to reproduce (with analysis parameter, and potential instructions to compile).

image


  const fetchMessage = async () => {
    return 'hello';
  };

  useEffect(() => {
    const fetchTemplates = async () => {
      try {
        const content = await fetchMessage();
        console.log(content);
      } finally {
        console.log('finally');
      }
    };
    if (visible) {
      fetchTemplates();
    }
  }, [classifications, formatMessage, visible]);


The async function returns a promise however sonar says its a non-promise

Thanks for your report, Reetesh.

We already investigating report on false positive for this rule. Please track the progress on this post:

I’ll close this one as a duplicate. Have a good day!