Unable to use eslint in a monorepo

In my monorepo action where I tried to do eslint integration, it shows that it cannot find the source and thus not put in any results.

ESlint is run by turbo which ends up like

eslint -f json -o eslint.report.json

I can verify that the files exist.

Also the minimatch pattern doesn’t work

sonar.eslint.reportPaths=**/eslint.report.json

So I did

      - run: |
          echo "sonar.eslint.reportPaths=$(find . -name 'eslint.report.json' -print | paste -sd ',')" >> sonar-project.properties
        name: Patch sonar-project.properties

Hi,

This is likely an issue of the paths in the report not matching the paths analysis sees.

In fact, that seems to be the case for multiple reports:

18:26:46.523 INFO  Analysing [/github/workspace/node_modules/stream-buffers/coverage/lcov.info, /github/workspace/packages/my-app/coverage/lcov.info]
18:26:46.540 WARN  Could not resolve 8 file paths in [/github/workspace/node_modules/stream-buffers/coverage/lcov.info, /github/workspace/packages/my-app/coverage/lcov.info]
18:26:46.540 WARN  First unresolved path: /home/travis/build/samcday/node-stream-buffer/lib/streambuffer.js (Run in DEBUG mode to get full list of unresolved paths)
18:26:46.540 INFO  Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=1401ms
18:26:46.542 INFO  Sensor Import of ESLint issues [javascript]
18:26:46.542 INFO  Importing /github/workspace/./packages/my-app/eslint.report.json
18:26:46.543 WARN  No input file found for /home/runner/work/expo-experiments/expo-experiments/packages/my-app/__mocks__/@react-native-async-storage/async-storage.ts. No ESLint issues will be imported on this file.
18:26:46.544 WARN  No input file found for /home/runner/work/expo-experiments/expo-experiments/packages/my-app/__mocks__/react-native-file-viewer.ts. No ESLint issues will be imported on this file.

You’re sure the files exist, but do they exist at those paths? What are the paths, relative to where analysis is run from?

 
Ann