From 58807ff3957e5142fa9fa75493171b5ed9241dce Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 4 Aug 2026 15:53:35 +0000 Subject: [PATCH] Make the lint targets resolve their own tooling 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 Claude-Session: https://claude.ai/code/session_01MMnjJ8yWJsui7jLqqrDrL4 --- Makefile | 2 +- package.json | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 54a9a816f..716c38144 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ lint-openapi: npm run lint:openapi lint-spectral: - npx spectral lint openapi.yaml --fail-severity=error + npm run lint:spectral lint-markdown: npm run lint:markdown diff --git a/package.json b/package.json index dbaec30c1..b5aa3d1d1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "scripts": { "build:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && cp openapi.yaml mintlify/openapi.yaml", "prelint:openapi": "npm run build:openapi", - "lint:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && npx @redocly/cli lint openapi.yaml && npx spectral lint openapi.yaml --fail-severity=error && cp openapi.yaml mintlify/openapi.yaml", + "lint:openapi": "npx @redocly/cli bundle openapi/openapi.yaml -o openapi.yaml && npx @redocly/cli lint openapi.yaml && spectral lint openapi.yaml --fail-severity=error && cp openapi.yaml mintlify/openapi.yaml", + "lint:spectral": "spectral lint openapi.yaml --fail-severity=error", + "lint:markdown": "markdownlint \"mintlify/**/*.mdx\"", "lint": "npm run lint:openapi", "broken-links": "cd mintlify && mint broken-links", "validate": "npm run lint",