{"record":{"id":"dd871b5909020a59","repo":"affaan-m/ECC","slug":"invalid-hooks-value-options-hooks","errorCode":null,"errorMessage":"Invalid --hooks value: ${options.hooks}","messagePattern":"Invalid --hooks value: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/setup.js","lineNumber":110,"sourceCode":"    } else if (argument === '--move-scope') {\n      options.moveScope = true;\n    } else if (argument === '--json') {\n      options.json = true;\n    } else if (argument === '--help' || argument === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`Unknown argument: ${argument}`);\n    }\n  }\n\n  if (options.mode !== undefined && options.mode !== MODE) {\n    throw new Error(`Invalid setup mode: ${options.mode}. This command currently supports ${MODE}.`);\n  }\n  if (options.scope !== undefined && !VALID_SCOPES.has(options.scope)) {\n    throw new Error(`Invalid --scope value: ${options.scope}`);\n  }\n  if (options.hooks !== undefined && !VALID_HOOK_MODES.has(options.hooks)) {\n    throw new Error(`Invalid --hooks value: ${options.hooks}`);\n  }\n  if (options.moveScope && options.scope === undefined) {\n    throw new Error('--move-scope requires an explicit --scope destination.');\n  }\n  return options;\n}\n\nfunction questionWithCancellation(terminal, prompt) {\n  return new Promise((resolve, reject) => {\n    let settled = false;\n    const finish = callback => value => {\n      if (settled) return;\n      settled = true;\n      terminal.removeListener('close', onClose);\n      callback(value);\n    };\n    const onClose = finish(() => {\n      const error = new Error('Readline was closed before an answer was received.');","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/setup.js#L92-L128","documentation":"Thrown by setup.js when --hooks is provided but is not in VALID_HOOK_MODES ({off, minimal, standard, strict}). The hook mode selects which automated hook profile is installed, so an unrecognized mode is rejected rather than silently installing no hooks.","triggerScenarios":"Passing `--hooks all`, `--hooks default`, `--hooks none`, or any value outside off/minimal/standard/strict.","commonSituations":"Expecting an 'all' or 'none' alias; typos like `--hooks standart`; carrying over hook names from a previous ECC version.","solutions":["Use one of: off, minimal, standard, or strict.","Use `off` to disable hooks, `strict` for the most aggressive profile.","Omit --hooks to choose interactively."],"exampleFix":"# before\nnode scripts/setup.js --hooks all --yes\n# after\nnode scripts/setup.js --hooks strict --yes","handlingStrategy":"validation","validationCode":"const HOOK_MODES = new Set(['off', 'minimal', 'standard', 'strict']);\nconst hooks = (process.argv.find(a => a.startsWith('--hooks')) || '').split('=')[1];\nif (hooks !== undefined && !HOOK_MODES.has(hooks)) { console.error(`Invalid hooks mode: ${hooks}`); process.exit(2); }","typeGuard":"function isValidHookMode(v) { return ['off','minimal','standard','strict'].includes(v); }","tryCatchPattern":"try { parseArgs(process.argv); } catch (err) { console.error(err.message); process.exit(2); }","preventionTips":["Publish the hook-mode set in --help text and shell completion.","Default to a documented mode rather than letting users guess names."],"tags":["cli","argument-parsing","setup","hooks"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}