fix(npm,lint): remove hardcoded allowlists, forward args untouched#2860
fix(npm,lint): remove hardcoded allowlists, forward args untouched#2860guyoron1 wants to merge 1 commit into
Conversation
Delete NPM_SUBCOMMANDS and stop injecting `run` — npm commands now pass through unchanged so future npm subcommands work automatically. Remove `lint` (script name) from lint rewrite rule so `pnpm lint` and `npm run lint` are no longer rewritten to `rtk lint`, preserving the package.json script's flags, chains, and exit codes. Direct linter invocations (`eslint`, `biome`) continue to route through rtk lint. Fixes rtk-ai#2663, fixes rtk-ai#2094
|
Hey @guyoron1 thanks for addressing this more durable fix, will avoid further maintenance. npm run inject part -> validlint part -> lost rewriteRemoving lint from the rule fixes the substitution, but it deletes the rewrite entirely, not just the substitution. pnpm lint, npm lint, bare lint -> match no rule -> run raw The npm part shows the pattern to follow: there the rewrite and the substitution are separate, so dropping the injection kept the rewrite + filter. On lint they're fused, the rewrite target rtk lint is the substitution. proposed fixMirror your npm half: keep the rewrite, drop only the substitution. 1 - npm run lint / pnpm run lint: already fine after this PR,nothing to do. 2 - Bare pnpm lint: the only routing gap. Extend the generic pnpm rule to wrap bare invocations → rtk pnpm lint. Important: wrap any bare pnpm , not just lint, enumerating script names would recreate the exact kind of list this PR removes. 3 - Compression recovery (follow-up) enhance the npm/pnpm output filter to detect lint-style diagnostics (file:line:col + rule id) and compress around them: collapse clean/progress lines, keep diagnostics, tee tail hint the tail. Thanks for your work |
Heyaaaa all :)
Fixes #2663, fixes #2094
Following @aeppling's feedback on #2664 — instead of patching the allowlists, this removes them entirely.
npm
Deletes
NPM_SUBCOMMANDS(the 70-entry list).rtk npmnow forwards args untouched to npm — no moreruninjection. Ifnpm buildisn't a real subcommand, npm errors and the agent self-corrects tonpm run build. Future npm commands (query,sbom, whatever they add next) just work without RTK updates.lint
Removes
lint(the script name) from the lint rewrite rule.pnpm lint/npm run lintare no longer rewritten tortk lint, so the package.json script's flags, chains, and exit code are preserved. Direct linter calls (eslint,biome,npx eslint, etc.) still route throughrtk lintas before.rtk npm querynpm run query(broken)npm query(works)pnpm lintrtk lint(flags lost)eslint src/rtk lintrtk lint(unchanged)Net -104 lines — more deleted than added.
Test plan
cargo fmt && cargo clippy --all-targets && cargo test --all— 2361 passedtest_classify_lint_scripts_not_rewritten+test_rewrite_lint_scripts_not_rewritten_to_rtk_lint