Me and my group are trying to integrate ESlint into Sonarcloud with Gitlab pipeline, but we receive and error and pipeline fails with exit code 1.
The content of the sonar-properties file is:
sonar.projectKey=**
sonar.organization=**
sonar.testExecutionReportPaths=reports/test-reporter.xml
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.eslint.reportPaths=reports/eslint-report.json
sonar.sources=src
sonar.tests=src
sonar.test.inclusions=src//*.spec.ts,src//.test.ts,src/app/test.ts,src/app/.spec.ts
The content of the .gitlab-ci.yml file :
variables:
SONAR_USER_HOME: “${CI_PROJECT_DIR}/.sonar” # Defines the location of the analysis task cache
GIT_DEPTH: “0” # Tells git to fetch all the branches of the project, required by the analysis task
sonarcloud-check:
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
cache:
key: “${CI_JOB_NAME}”
paths:
- .sonar/cache
script:
- npm install
- npm test – --coverage --testResultsProcessor=jest-sonar-reporter
- npx eslint -f json -o reports/eslint-report.json src
- cat reports/eslint-report.json
- sonar-scanner -X
only:
- merge_requests
- master
- develop
- main
- testbranch
How can we solve this issue ?