Cannot display eslint results on SonarCloud

  • ALM used GitHub
  • Scanner command used when applicable (private details masked)
name: Build
on:
 push:
   branches:
     - main
 pull_request:
   types: [opened, synchronize, reopened]
jobs:
  sonarcloud:
    name: SonarCloud
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: pnpm/action-setup@v2
        with:
          version: 7.26.0
      - uses: actions/setup-node@v3
        with:
          node-version: "16"
          cache: "pnpm"
          cache-dependency-path: "**/pnpm-lock.yaml"
      - name: Install dependencies
        run: pnpm install
      - name: Test and coverage
        run: pnpm jest --coverage
      - name: lint
        run: pnpm lint:json
      - name: SonarCloud Scan
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets. SONAR_TOKEN }}
  • Languages of the repository: typescript
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
    WARN: No input file found for /home/runner/work/**/*.tsx. No ESLint issues will be imported on this file.
  • Steps to reproduce

I output the eslint.json file using the GitHub Actions pnpm lint:json, but it outputs
WARN: No input file found for /home/runner/work/**/*.tsx" and I cannot see any warning or error by eslint on SonarCloud.

Hi,

Welcome to the community!

It’s not clear to me what the problem is. Are you not seeing in your SonarCloud analysis the files you expected to be analyzed?

 
Ann

Hi Ann.

I would also like to view ESlint analysis results on SonarCloud.

I found this page as a reference.

However, I get the above error and the eslint results are not displayed at all.

Hi,

SonarCloud analysis won’t run ESLint for you. You can run it before analysis and import its report. But successfully running ESLint is out of scope for this community.

 
Ann