Can not import eslint issues report in macos

system info:

INFO: Scanner configuration file: /Users/macbookpro/Downloads/sonar-scanner-4.7.0.2747-macosx/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Mac OS X 12.4 x86_64

error message:

Importing /Users/macbookpro/Documents/zmn/ccs-front/eslint_report.json
ERROR: No issues information will be saved as the report file can't be read.
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
	at com.google.gson.Gson.fromJson(Gson.java:975)
	at com.google.gson.Gson.fromJson(Gson.java:901)
	at org.sonar.plugins.javascript.external.EslintReportSensor.importReport(EslintReportSensor.java:62)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.lambda$execute$1(AbstractExternalIssuesSensor.java:54)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at org.sonar.plugins.javascript.external.AbstractExternalIssuesSensor.execute(AbstractExternalIssuesSensor.java:54)
	at org.sonar.plugins.javascript.external.EslintReportSensor.execute(EslintReportSensor.java:43)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:392)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:388)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:357)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:134)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
	at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:349)
	at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70)
	at com.google.gson.Gson.fromJson(Gson.java:963)
	... 36 common frames omitted

eslint_report.json

{ "issues": [
  {
    "engineId": "test",
    "ruleId": "rule1",
    "severity":"BLOCKER",
    "type":"CODE_SMELL",
    "primaryLocation": {
      "message": "fully-fleshed issue",
      "filePath": "sources/A.java",
      "textRange": {
        "startLine": 30,
        "endLine": 30,
        "startColumn": 9,
        "endColumn": 14
      }
    },
    "effortMinutes": 90,
    "secondaryLocations": [
      {
        "message": "cross-file 2ndary location",
        "filePath": "sources/B.java",
        "textRange": {
          "startLine": 10,
          "endLine": 10,
          "startColumn": 6,
          "endColumn": 38
        }
      }
    ]
  },
  {
    "engineId": "test",
    "ruleId": "rule2",
    "severity": "INFO",
    "type": "BUG",
    "primaryLocation": {
      "message": "minimal issue raised at file level",
      "filePath": "sources/Measure.java"
    }
  }
]}

How are you generating the ESLint report? Are you using the -f json formatted as mentioned in the docs?

thanks for your reply.

the Eslint report listed above is a copy from the doc doc

That’s a completely different report format, which would be passed to sonar.externalIssuesReportPaths rather than sonar.eslint.reportPaths