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: https://www.sonarqube.org/community/

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 upgrade notes here: https://docs.sonarqube.org/latest/setup/upgrade-notes/

SonarQube 8.5 release annoucement: https://www.sonarqube.org/sonarqube-8-5/

Joe