ci(frontend): lint changed lines via eslint-plugin-diff#7822
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7822 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 1467 1467
Lines 57332 57332
=======================================
Hits 56525 56525
Misses 807 807 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
90139e7 to
96f6ac5
Compare
96f6ac5 to
da0ab2a
Compare
da0ab2a to
18d625f
Compare
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
The previous job linted whole changed files, so touching a file with the frontend's pre-existing eslint backlog failed the PR on errors it never introduced — pushing contributors toward project-wide `lint:fix` (see #7733). eslint-plugin-diff's `plugin:diff/ci` config filters lint messages to lines changed vs the PR base. It is a no-op locally and in editors, running only under CI (the `CI` env var GitHub Actions sets). Pure eslint + git — no token — so it works on fork PRs too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18d625f to
2568f5e
Compare
Changes
The
Lint changed filesjob lints whole changed files. With the frontend's large pre-existing eslint backlog, touching any debt-laden file fails the PR on errors it never introduced — which nudges contributors toward project-widenpm run lint:fix(see #7733, where that swept ~21 unrelated files into the PR).This switches the job to eslint-plugin-diff (
plugin:diff/ci), which filters lint messages to the lines a PR changed:CIenv var Actions sets).GITHUB_TOKENwrites, so it works on fork PRs too.ESLINT_PLUGIN_DIFF_COMMIT).The workflow step is now just
npm run lintwith that env var — no bespoke script, no third-party CI action.How did you test this code?
Locally: with
CI=true ESLINT_PLUGIN_DIFF_COMMIT=<base>, eslint reported only the appended error and ignored the pre-existing ones. This PR's CI run confirms the same in the Actions runner via the temp commit.