Getting "Expected an assignment or function call and instead saw an expression" for typescript lambda functions

SonarQube Developer Edition 8.3.1.34397
Quality Profile: Typescript Sonar Way

Hi,
Please refer the below image.

The above error is shown for a Typescript Lambda function. I can’t understand why this is showing as an error. Can you please help me to get this clarified and fixed.

Any help would be much appreciated. :slight_smile:

Hello @Rishanthakumar,

We will support optional chaining with SonarJS in SonarQube 8.5 based on our development team here, which will be released very soon. Keep on eye on the What’s new page and look for the latest download here. I also highly suggest you sign up for our announcement email on this page as well: Sonar Community - Home of Clean Code

Please also note this:

Since SonarTS v2.0, TypeScript analysis is performed by SonarJS analyzer v6.0 or later. No TypeScript analysis is performed by SonarTS.)

Joe

An update!

We have release SonarQube 8.5, which should resolve your optional chaining issue.

See our general upgrade notes here: Release Upgrade Notes | SonarQube Docs

SonarQube 8.5 release annoucement: SonarQube 8.5 - Love for Java, C#, C++ and more; Code Quality for your Java & PHP unit tests | SonarQube

Joe

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.