fix: resolve ESLint errors and add npx command support in hook tests

Remove unused loadInstallManifests import and prefix unused result
variable with underscore in selective-install tests. Add npx as an
approved command prefix in hook validation tests.
This commit is contained in:
Affaan Mustafa
2026-03-20 02:11:12 -07:00
parent 47f508ec21
commit a2df9397ff
3 changed files with 6 additions and 5 deletions

View File

@@ -673,6 +673,7 @@ async function runTests() {
const isInline = hook.command.startsWith('node -e');
const isFilePath = hook.command.startsWith('node "');
const isNpx = hook.command.startsWith('npx ');
const isShellWrapper =
hook.command.startsWith('bash "') ||
hook.command.startsWith('sh "') ||
@@ -681,8 +682,8 @@ async function runTests() {
const isShellScriptPath = hook.command.endsWith('.sh');
assert.ok(
isInline || isFilePath || isShellWrapper || isShellScriptPath,
`Hook command in ${hookType} should be node -e, node script, or shell wrapper/script, got: ${hook.command.substring(0, 80)}`
isInline || isFilePath || isNpx || isShellWrapper || isShellScriptPath,
`Hook command in ${hookType} should be node -e, node script, npx, or shell wrapper/script, got: ${hook.command.substring(0, 80)}`
);
}
}