Make the lint targets resolve their own tooling - #795
Draft
shreyav wants to merge 1 commit into
Draft
Conversation
Two separate faults in the lint plumbing. make lint-markdown ran npm run lint:markdown, and no such script existed, so the target had never worked - it failed with "Missing script" rather than any lint output. markdownlint-cli is already a devDependency and .markdownlint.json is already committed, so the script was the only missing piece. It now runs, and it reports real violations: roughly 450 across mintlify/**/*.mdx, mostly MD031, MD012, MD022 and MD009. Those want a separate mechanical pass, and one should not land while large doc PRs are open - the point here is that the target does its job instead of erroring. lint:openapi and lint-spectral invoked "npx spectral". That works once dependencies are installed, but on a clean checkout npx finds no local spectral binary and silently downloads an unrelated registry package of that name, then runs it. The lint appears to pass having executed something nobody vetted. Calling the binary directly from an npm script uses node_modules/.bin and cannot fall through to the registry. Adds lint:spectral so the Makefile target routes through npm rather than reaching for npx itself. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
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
Two unrelated faults in the lint plumbing.
Makefile+package.json, 4 lines.1.
make lint-markdownnever workedThe target runs
npm run lint:markdown, and that script doesn't exist — so it failed with npm's "Missing script" error rather than any lint output.markdownlint-cliis already a devDependency and.markdownlint.jsonis already committed, so the script was the only missing piece. Added:The target now fails with real lint output instead of a missing-script error — roughly 450 violations across
mintlify/**/*.mdx, dominated byMD031(79),MD012(77),MD022(74) andMD009(74). Almost all are whitespace.That is the intended outcome here: a linter reporting genuine violations is working, and the previous state hid them entirely. Fixing the 450 is deliberately not in this PR — it's a large mechanical reformat that would conflict with every open docs PR, including #794, which adds 927 lines to
external-accounts.mdx. It should land on its own once the docs queue is clear.2.
npx spectralcan execute a package nobody vettedlint:openapiand thelint-spectraltarget both callednpx spectral. That resolves correctly once dependencies are installed —@stoplight/spectral-cliprovides aspectralbin.On a clean checkout it does not.
npxfinds no local binary, falls through to the registry, and silently downloads and runs an unrelated package that happens to be namedspectral. The lint then appears to pass, having executed something that isn't Spectral at all.Calling the binary directly from an npm script uses
node_modules/.binand cannot fall through:Also adds a
lint:spectralscript so the Makefile target routes through npm rather than reaching fornpxitself.Correcting something I've been repeating
I have described
make lintas "broken onmain" in several recent PR descriptions (#661, #777, #793, #794), attributing it tospectralresolving to a stub. That was overstated.make lintworks fine on a checkout with dependencies installed — I hit the failure in an environment wherenpm installhadn't been run and generalised from it. The stub-resolution hazard is real and worth removing, but it is a fresh-checkout footgun, not a permanently broken target. The genuinely broken one was alwayslint-markdown.Verification
make lint-spectral→ exit 0, andnode_modules/.bin/spectralconfirmed to symlink@stoplight/spectral-cli/dist/index.jsmake lint-markdown→ now executes the linter and reports violations (exit 1) instead of "Missing script"package-lock.jsonuntouchedpackage.jsonkept readable; no other scripts alteredGenerated by Claude Code