Skip to content

chore(lint): run lint after lint:fix when files provided#29690

Merged
caugner merged 2 commits into
mdn:mainfrom
danyalahmed1995:fix/29615-lint-fix-unfixable-errors
May 22, 2026
Merged

chore(lint): run lint after lint:fix when files provided#29690
caugner merged 2 commits into
mdn:mainfrom
danyalahmed1995:fix/29615-lint-fix-unfixable-errors

Conversation

@danyalahmed1995

Copy link
Copy Markdown
Contributor

Summary

Fixes npm run lint:fix so it exits with a failure when unfixable lint errors remain after the fixer runs.

Previously, lint:fix could successfully apply available fixes and exit 0, even when a follow-up npm run lint would still fail on the same target files. This made the command report success for cases it could not fully fix.

The fix reuses the normal lint pass after running the existing fixers and exits non-zero when lint errors remain.

Fixes #29615.

Validation

  • npm run lint:fix -- http/headers/X-Frame-Options.json
  • npm run lint -- http/headers/X-Frame-Options.json
  • Temporarily reproduced the missing spec_url case from Fixer does not report "Marked as standard_track, but missing required spec_url" #29615 and confirmed lint:fix now exits with failure when the remaining lint error is unfixable.
  • npm run format
  • npm run lint
  • Unit tests passed with the PowerShell-compatible equivalent after the npm script hit Windows NODE_ENV shell syntax.

@danyalahmed1995 danyalahmed1995 requested review from a team as code owners May 18, 2026 03:00
@danyalahmed1995 danyalahmed1995 requested a review from caugner May 18, 2026 03:00
@github-actions github-actions Bot added infra Infrastructure issues (npm, GitHub Actions, releases) of this project linter Issues or pull requests regarding the tests / linter of the JSON files. size:xs [PR only] 0-6 LoC changed labels May 18, 2026
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

System file check failed because I changed the lint/fix.js 🫠

Comment thread lint/fix.js Outdated
@caugner caugner added the meeting agenda Issues or pull requests in need of discussion in a project meeting. label May 18, 2026
Comment thread lint/fix.js Outdated
Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>

@caugner caugner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, tested locally.

On main:

% time npm run lint:fix http

> @mdn/browser-compat-data@7.3.16 lint:fix
> node lint/fix.js http

npm run lint:fix http  0.92s user 0.45s system 32% cpu 4.174 total

On this branch:

% time npm run lint:fix http

> @mdn/browser-compat-data@7.3.16 lint:fix
> node lint/fix.js http

Loading and checking files...
Testing browser data...
Testing feature data...
Testing all features together...
All data passed linting!
Linters have some exceptions, please help us remove them!
  Flag data has 2 exceptions
   - api.Notification.requireInteraction
   - api.Window.dump
  Obsolete has 1 exception
   - html.elements.track.kind.descriptions
npm run lint:fix http  1.30s user 0.49s system 80% cpu 2.217 total

This increase is runtime is acceptable and fine.

@caugner caugner changed the title fix(lint): fail lint:fix when unfixable errors remain chore(lint): run lint after lint:fix when files provided May 22, 2026
@caugner caugner merged commit 7a4dbae into mdn:main May 22, 2026
9 of 10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in BCD meeting agenda May 22, 2026
@danyalahmed1995

Copy link
Copy Markdown
Contributor Author

@caugner Thanks , but if you feel like this needs be addressed perhaps we can open a new issue and work on a fix for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra Infrastructure issues (npm, GitHub Actions, releases) of this project linter Issues or pull requests regarding the tests / linter of the JSON files. meeting agenda Issues or pull requests in need of discussion in a project meeting. size:xs [PR only] 0-6 LoC changed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fixer does not report "Marked as standard_track, but missing required spec_url"

3 participants