SonarQube does not report all issues in eslint report file

Hi!

I’m using SonarQube Community Edition Version 8.9, and I’m trying to import my eslint issues into SonarQube.

It is working, however I noticed that some issues are not reported. At first I thought it was only reporting errors and not warnings, but on closer inspection it is including some warnings, but not others.

Is this a bug? Or just something missing in some eslint rule to issue mapping in SonarQube?

Thanks!!!

Hi,

Welcome to the community!

There’s not a mapping. Everything in your report should be imported as an external issue.

Do you see any patterns in what’s imported/not? Anything interesting in your analysis logs?

 
Ann

Hi Ann!

Thanks for commenting. I’ll try to find some time soon to get you an example.

Hi!

We faced the same issue. Indeed, some rules present in the eslint report are not imported in SonarQube.
In our case, the following rule (in our production code) was not imported:

{
  "ruleId": "space-infix-ops",
  "severity": 2,
  "message": "Operator '=' must be spaced.",
  "line": 46,
  "column": 32,
  "nodeType": "AssignmentExpression",
  "messageId": "missingSpace",
  "endLine": 46,
  "endColumn": 33,
  "fix": {
    "range": [
      1211,
      1212
    ],
    "text": " = "
  }
}

However we tried to add exactly the same code in a side project and everything worked perfectly.

We tried several things:

  • introducing the same error in another place
  • side project
  • several sonar versions
  • minimal report with only this error

We didn’t find any solution and we don’t know how to investigate more.

We tried SonarQube version 9.6.1 and 9.9

Hi @ngrange,

Since you see varying behavior, do you have any tips for being able to reproduce this consistently?

Perhaps you could boil your production code example down to a reproducer?

 
Ann

I met the same issues like you, Are you solved your problems?