Skip to content

Conversation

@hanna-skryl
Copy link
Collaborator

@hanna-skryl hanna-skryl commented Sep 2, 2025

Closes #713 closes #721

This PR finalizes scoreTarget/scoreTargets feature implementation, allowing users to configure threshold values for audits across all plugins.

Changes

  • Replace perfectScoreThreshold with scoreTargets in the coverage plugin
  • Add scoreTargets support to all plugins: ESLint, Lighthouse, JS Packages, TypeScript, and JSDoc
  • Add tests demonstrating score impact

Breaking change

Coverage plugin: perfectScoreThresholdscoreTargets

Usage

// Single target for all audits
export default {
  // ... core config ...
  plugins: [
    // ... other plugins ...
    await coveragePlugin({
      reports: ['coverage/lcov.info'],
      scoreTargets: 0.8,
    })
  ]
}

// Per-audit targets
export default {
  // ... core config ...
  plugins: [
    // ... other plugins ...
    await coveragePlugin({
      reports: ['coverage/lcov.info'],
      scoreTargets: { 'line-coverage': 0.9, 'branch-coverage': 0.75 },
    })
  ]
}

@nx-cloud
Copy link

nx-cloud bot commented Sep 2, 2025

View your CI Pipeline Execution ↗ for commit 4afb131

Command Status Duration Result
nx code-pushup --nx-bail -- compare --verbose ✅ Succeeded 1m 5s View ↗
nx code-pushup --nx-bail -- --verbose ✅ Succeeded 2m 46s View ↗
nx code-pushup --nx-bail -- print-config --verb... ✅ Succeeded 4m 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-03 16:36:43 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 2, 2025

Open in StackBlitz

@code-pushup/ci

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/ci@1099

@code-pushup/cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/cli@1099

@code-pushup/create-cli

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/create-cli@1099

@code-pushup/core

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/core@1099

@code-pushup/models

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models@1099

@code-pushup/nx-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/nx-plugin@1099

@code-pushup/coverage-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/coverage-plugin@1099

@code-pushup/eslint-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/eslint-plugin@1099

@code-pushup/js-packages-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/js-packages-plugin@1099

@code-pushup/jsdocs-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/jsdocs-plugin@1099

@code-pushup/lighthouse-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/lighthouse-plugin@1099

@code-pushup/typescript-plugin

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/typescript-plugin@1099

@code-pushup/utils

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/utils@1099

@code-pushup/models-transformers

npm i https://pkg.pr.new/code-pushup/cli/@code-pushup/models-transformers@1099

commit: 4afb131

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

Code PushUp

🤨 Code PushUp report has both improvements and regressions – compared current commit 58583f9 with previous commit b05dd6e.

🕵️ See full comparison in Code PushUp portal 🔍

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 40 🔴 39 ↓ −1.9
Code coverage 🟡 90 🟡 90 ↑ +0.1
Documentation 🔴 24 🔴 24 ↓ −0.1
Security 🟡 64 🟡 64
Updates 🟡 85 🟡 85
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟡 61 🟡 61
Type Safety 🟢 100 🟢 100
Bug prevention 🟢 100 🟢 100
Miscellaneous 🟢 100 🟢 100
Code style 🟢 100 🟢 100
👍 1 group improved, 👎 2 groups regressed, 👍 2 audits improved, 👎 6 audits regressed, 14 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 40 🔴 39 ↓ −1.9
Code coverage Code coverage metrics 🟡 90 🟡 90 ↑ +0.1
JSDoc coverage Documentation coverage 🔴 24 🔴 24 ↓ −0.1

18 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Total Blocking Time 🟥 1,330 ms 🟥 1,600 ms ↑ +20.4 %
Lighthouse Max Potential First Input Delay 🟥 550 ms 🟥 660 ms ↑ +20.3 %
Lighthouse Speed Index 🟨 5.7 s 🟨 5.7 s ↑ +1.6 %
Lighthouse First Contentful Paint 🟨 3.0 s 🟥 3.0 s ↑ +1.5 %
JSDoc coverage Functions coverage 🟥 518 undocumented functions 🟥 518 undocumented functions  +0 %
Code coverage Function coverage 🟩 92.2 % 🟩 92.3 % ↑ +0.1 %
Code coverage Branch coverage 🟨 85.5 % 🟨 85.5 % ↓ −0.1 %
Code coverage Line coverage 🟨 86.2 % 🟨 86.2 % ↑ +0.1 %
Lighthouse Avoids enormous network payloads 🟨 Total size was 2,673 KiB 🟨 Total size was 2,672 KiB ↓ −0.1 %
Lighthouse Minimizes main-thread work 🟥 7.8 s 🟥 8.7 s ↑ +11.7 %
Lighthouse Uses efficient cache policy on static assets 🟨 30 resources found 🟨 30 resources found ↓ −0.1 %
Lighthouse JavaScript execution time 🟥 3.2 s 🟥 3.6 s ↑ +12.1 %
Lighthouse Largest Contentful Paint 🟥 10.7 s 🟥 10.3 s ↓ −3.6 %
Lighthouse Initial server response time was short 🟩 Root document took 540 ms 🟩 Root document took 390 ms ↓ −27.2 %
Lighthouse Reduce unused CSS 🟥 Potential savings of 113 KiB 🟥 Potential savings of 113 KiB ↓ −23.3 %
Lighthouse Reduce unused JavaScript 🟥 Potential savings of 608 KiB 🟥 Potential savings of 608 KiB ↓ −15.4 %
Lighthouse Time to Interactive 🟥 15.9 s 🟥 15.7 s ↓ −0.8 %
Lighthouse Metrics 🟩 100% 🟩 100% ↓ −0.8 %
Lighthouse Server Backend Latencies 🟩 1,450 ms 🟩 1,540 ms ↑ +6.1 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 85 KiB 🟥 Potential savings of 97 KiB ↑ +3.3 %
Lighthouse Network Round Trip Times 🟩 10 ms 🟩 10 ms ↓ −14.7 %
Lighthouse Cumulative Layout Shift 🟩 0.001 🟩 0 ↓ −100 %

588 other audits are unchanged.

@hanna-skryl hanna-skryl marked this pull request as ready for review September 2, 2025 21:39
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature!! One small improvement/nitpick popped up on how to mock functions, the rest is fine for me.

BioPhoton
BioPhoton previously approved these changes Sep 3, 2025
Copy link
Collaborator

@BioPhoton BioPhoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for adjusting the mock code!

@hanna-skryl hanna-skryl merged commit 4c96419 into main Sep 3, 2025
18 checks passed
@hanna-skryl hanna-skryl deleted the score-targets-config-implementation branch September 3, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add scoreTarget as CLI feature for audits Implement scoreTarget as CLI feature for categories

4 participants