Add ESLint CI workflow with baseline (mirrors PHPStan setup)#3299
Open
limad wants to merge 1 commit intojeedom:developfrom
Open
Add ESLint CI workflow with baseline (mirrors PHPStan setup)#3299limad wants to merge 1 commit intojeedom:developfrom
limad wants to merge 1 commit intojeedom:developfrom
Conversation
Introduces a CI ESLint check focused on bug-catching rules
(no-const-assign, no-redeclare, no-dupe-args, no-dupe-keys,
no-unreachable, etc.) without enforcing style rules like no-var
or prefer-const yet, to keep the diff focused.
Mirrors the existing PHPStan baseline workflow:
- eslint-baseline.json captures the 175 currently-failing tuples
({file, ruleId, message}, line numbers excluded for stability)
- .github/scripts/eslint-baseline-check.js diffs current run vs
baseline; CI fails only on NEW violations, allowing existing
ones to be tolerated and fixed incrementally
- update-baseline job auto-regenerates the baseline on push to
develop and opens a PR (mirror of update-phpstan-baseline)
Local usage:
npm install
npm run lint:check # verify no new violations
npm run lint:baseline # regenerate baseline after fixes
This was referenced Apr 28, 2026
kwizer15
approved these changes
Apr 28, 2026
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
Adds a CI ESLint check for
core/js/anddesktop/js/with a baseline mechanism that mirrors the existing PHPStan workflow (per @kwizer15's suggestion in #3297). Catches actual bugs (no-const-assign,no-redeclare,no-unreachable, etc.) without enforcing style rules likeno-varorprefer-constyet.What's added
.eslintrc.jsoneslint-baseline.json{file, ruleId, message}tuples — line numbers excluded so the baseline survives cosmetic line shifts.github/scripts/eslint-baseline-check.js.github/workflows/eslint.ymldevelop. Includes an auto-update job that regenerates the baseline and opens a PR when fixes are merged (same pattern asupdate-phpstan-baseline)package.json+package-lock.jsonWhy baseline-based
Upstream
core/js/+desktop/js/currently emit ~175 ESLint errors (mostlyno-redeclarefromvar Xre-declarations across nested blocks, plus a fewno-unreachable). A non-baseline approach would either:The baseline tolerates existing issues, prevents new ones, and welcomes fixes (when a violation disappears, the auto-update job removes it from the baseline on merge).
Style rules deferred
no-varandprefer-constare intentionally not enabled in this PR — they would dominate the noise. They can be re-enabled in a follow-up once the migration fromvartoconst/let(PRs C-F) lands.Local usage
Test plan
eslintjob on this PR — expect green (current = baseline = 175)npm run lint:checkupdate-baselinejob triggers on push todevelopPart of the split following #3297 discussion. Standalone — does not touch any existing JS files.