From: Jérôme Benoit Date: Wed, 25 Nov 2026 21:45:31 +0000 (+0100) Subject: ci(sonar): analyze TypeScript sources (#3423) X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=91690ba98269396ff3a5f79b4f88abadc49e1edc;p=poolifier.git ci(sonar): analyze TypeScript sources (#3423) Remap V8 coverage to the TypeScript sources so Sonar does not analyze generated declarations or count the unmapped Rollup entry point. --- diff --git a/package.json b/package.json index 2bf144950..5699dded7 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "benchmark:tinybench:debug": "pnpm build && node --enable-source-maps --inspect benchmarks/internal/bench.mjs -t tinybench", "test": "pnpm build --environment SOURCEMAP:false && vitest run", "test:debug": "pnpm build && vitest --inspect-brk --no-file-parallelism", - "test:coverage": "pnpm build --environment SOURCEMAP:false && vitest run --coverage", + "test:coverage": "pnpm build && vitest run --coverage", "format": "biome format . --write; eslint . --cache --fix", "lint": "eslint . --cache", "lint:fix": "eslint . --cache --fix", diff --git a/sonar-project.properties b/sonar-project.properties index d2af44cd5..19e59f640 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,14 +1,12 @@ sonar.projectKey=poolifier_poolifier sonar.organization=poolifier -sonar.javascript.exclusions=lib/**/*.cjs sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.projectName=poolifier # x-release-please-start-version sonar.projectVersion=6.1.1 # x-release-please-end sonar.host.url=https://sonarcloud.io -#sonar.sources=src -sonar.sources=lib +sonar.sources=src sonar.tests=tests #sonar.login=TOKEN # To use for local troubleshooting sonar.verbose=false diff --git a/vitest.config.ts b/vitest.config.ts index 13c9dc501..91c02911c 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -3,6 +3,8 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { coverage: { + exclude: ['lib/index.mjs'], + excludeAfterRemap: true, provider: 'v8', reporter: ['text', 'html', 'lcov'], thresholds: {