Problem
findScript('lint') / findScript('coverage') match the keyword against both the script key and its value. A script like "ci": "... eslint ..." can be wrongly elected as lintScript and later invoked as npm run ci -- --format json .... Same fragility for testCoverageScript.
Location
src/installer/detector.mjs:107-114
Suggested fix
Prefer exact/known key matches (lint, lint:js, test:coverage, test:cov, coverage) over substring-in-value matching; only fall back to value matching for unambiguous commands.
Acceptance
- A
ci/build script that merely mentions eslint/coverage in its value is not selected.
- Tests covering the disambiguation.
Problem
findScript('lint')/findScript('coverage')match the keyword against both the script key and its value. A script like"ci": "... eslint ..."can be wrongly elected aslintScriptand later invoked asnpm run ci -- --format json .... Same fragility fortestCoverageScript.Location
src/installer/detector.mjs:107-114Suggested fix
Prefer exact/known key matches (
lint,lint:js,test:coverage,test:cov,coverage) over substring-in-value matching; only fall back to value matching for unambiguous commands.Acceptance
ci/buildscript that merely mentions eslint/coverage in its value is not selected.