fix!: replace lintDirtyModulesOnly with lintOnStart - #320
Open
alexander-akait wants to merge 1 commit into
Open
Conversation
`lintDirtyModulesOnly: true` tapped watchRun alone, so a one-shot build ran the plugin and linted nothing at all — a CI build reporting a clean tree it never read. The option is now `lintOnStart`, inverted and defaulting to true: it says whether the first compilation lints every file it covers. A build is nothing but a first compilation, so it lints either way; a watch run set to false stays quiet until a file is touched and then reports only what webpack rebuilds, which is what the old option was reached for. Every other bundler's plugin lints a build by default or says plainly that it does not — vite-plugin-checker runs the whole lint under enableBuild, and vite-plugin-eslint2 is off under build unless asked. Neither has a setting that looks enabled and silently checks nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
alexander-akait
force-pushed
the
fix/lint-on-start
branch
from
September 8, 2026 14:37
26888f4 to
062fbe9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lintDirtyModulesOnly: truetappedwatchRunalone, so a one-shot build ran the plugin and linted nothing at all — a CI build reporting a clean tree it never read. The option becomeslintOnStart, inverted and defaulting totrue: it says whether the first compilation lints every file it covers. A build is nothing but a first compilation, so it lints either way; a watch run set tofalsestays quiet until a file is touched and then reports only what webpack rebuilds, which is what the old option was reached for.Measured before the change, with the
errorfixture: arun()build reports 1 error by default and 0 withlintDirtyModulesOnly: true. No other bundler's plugin behaves that way —vite-plugin-checkerlints a build underenableBuild: true, andvite-plugin-eslint2is off underbuildbut says so as its documented default. Neither has a setting that looks enabled and silently checks nothing.Stacked on #319 — its three commits are in this branch and leave the diff once it merges. Review the last commit only.
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes —
test/lint-on-start.test.jsandtest/stylelint/lint-on-start.test.js(renamed fromlint-dirty-modules-only), each gaining a case that a build still lints withlintOnStart: false.Does this PR introduce a breaking change?
Yes.
lintDirtyModulesOnlyis gone.lintDirtyModulesOnly: truebecomeslintOnStart: false; leaving it unset was already the default and stays so. A build that relied onlintDirtyModulesOnly: trueto skip linting will now lint — remove the plugin from that config instead.If relevant, what needs to be documented once your changes are merged or what have you already documented?
The
lintOnStartoption and both migration tables are updated inREADME.mdin this PR; the webpack.js.org page needs the same rename after release.Use of AI
AI was used. Claude Code investigated how the equivalent plugins for Vite, Rollup and esbuild behave in build versus watch, measured this plugin's own behaviour in both modes, then wrote the change, the tests and the documentation. Every claim in this description was verified by running it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
Generated by Claude Code