Skip to content

Prefer lint:js for ESLint and annotate package.json lint failures - #41

Open
jeremyfelt wants to merge 1 commit into
trunkfrom
feature/lint-js-preference-and-package-json-annotations
Open

Prefer lint:js for ESLint and annotate package.json lint failures#41
jeremyfelt wants to merge 1 commit into
trunkfrom
feature/lint-js-preference-and-package-json-annotations

Conversation

@jeremyfelt

Copy link
Copy Markdown
Member

Two changes to js-checks.yml, both from what the rollout across 58 repositories surfaced.

Prefer lint:js over lint

The ESLint check resolved lint first. On the site builds lint is a composite — npm run lint:css && npm run lint:js — so Stylelint ran twice and a CSS failure was reported under the ESLint check. The order is now lint:js lint, so lint remains the fallback for projects that only define it.

Annotate package.json lint failures

Every other check annotates the line it fails on. npm-package-json-lint was the exception: it has no GitHub reporter, and it reports the offending package.json node rather than a line number, so a failure said what was wrong but not where.

Its output is now captured and mapped back onto the file:

  • devDependencies are not in alphabetical order annotates the "devDependencies" line.
  • license is required has nothing to point at, so it lands on line 1.
  • Both output styles are handled — releases differ on whether an issue is marked / or ERROR/WARNING.
  • working-directory is respected, so the annotation path is relative to the repository root.

Parsing was checked against real npm-package-json-lint output in both styles, including a nested working directory and the missing-node fallback.

🤖 Generated with Claude Code

The ESLint check resolved `lint` before `lint:js`. On several site builds
`lint` is a composite that runs the CSS lint too, so Stylelint ran twice and
its failures were reported under the ESLint check. `lint:js` is now preferred,
with `lint` kept as the fallback for projects that only define it.

npm-package-json-lint was the one check that failed without saying where. It has
no GitHub reporter and names the offending package.json node rather than a line,
so its output is now captured and mapped back onto the file, matching the
annotations ESLint, Stylelint, PHPCS, and PHPStan already produce.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant