{"record":{"id":"4c05b321b9154e69","repo":"pbakaus/impeccable","slug":"config-commentsyntax-must-be-html-or-jsx","errorCode":null,"errorMessage":"config.commentSyntax must be 'html' or 'jsx'","messagePattern":"config\\.commentSyntax must be 'html' or 'jsx'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/live-inject.mjs","lineNumber":469,"sourceCode":"  if (!Array.isArray(cfg.files) || cfg.files.length === 0) {\n    throw new Error('config.files (non-empty string array) required');\n  }\n  if (!cfg.files.every((f) => typeof f === 'string' && f.length > 0)) {\n    throw new Error('config.files must contain only non-empty strings');\n  }\n  if (cfg.exclude !== undefined) {\n    if (!Array.isArray(cfg.exclude)) {\n      throw new Error('config.exclude, if present, must be a string array');\n    }\n    if (!cfg.exclude.every((f) => typeof f === 'string' && f.length > 0)) {\n      throw new Error('config.exclude must contain only non-empty strings');\n    }\n  }\n  if (typeof cfg.insertBefore !== 'string' && typeof cfg.insertAfter !== 'string') {\n    throw new Error('config.insertBefore or config.insertAfter (string) required');\n  }\n  if (cfg.commentSyntax !== 'html' && cfg.commentSyntax !== 'jsx') {\n    throw new Error(\"config.commentSyntax must be 'html' or 'jsx'\");\n  }\n  if (cfg.cspChecked !== undefined && typeof cfg.cspChecked !== 'boolean') {\n    throw new Error(\"config.cspChecked, if present, must be a boolean\");\n  }\n}\n\n// ---------------------------------------------------------------------------\n// Auto-execute\n// ---------------------------------------------------------------------------\n\nconst _running = process.argv[1];\nif (_running?.endsWith('live-inject.mjs') || _running?.endsWith('live-inject.mjs/')) {\n  enterLiveRoot();\n  injectCli();\n}\n\n// Re-exported so long-standing importers (live.mjs, the adapter modules, the\n// test suites) keep their entry points while the implementations live in","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/live-inject.mjs#L451-L487","documentation":"validateConfig() requires cfg.commentSyntax to be exactly 'html' or 'jsx'. There is no default: the field decides whether the injected block uses <!-- --> or {/* */ *} comment syntax, so an omitted or misspelled value is rejected rather than guessed. Any other string (or non-string) fails.","triggerScenarios":"commentSyntax missing from the config; commentSyntax: \"HTML\" (case-sensitive); \"js\", \"tsx\", \"ts\", or \"javascript\" — none of the alternatives are accepted, only the literal 'html' and 'jsx'.","commonSituations":"JS/TS projects assuming a 'js' or 'ts' value; uppercase values from hand editing; configs generated from a form that labels the option differently.","solutions":["Set \"commentSyntax\": \"html\" for HTML/Astro-ish targets or \"commentSyntax\": \"jsx\" for JSX/TSX-style comments","Lowercase the value — the comparison is exact","For React/Next projects use 'jsx' even in .js files that contain JSX"],"exampleFix":"// before\n\"commentSyntax\": \"tsx\"\n\n// after\n\"commentSyntax\": \"jsx\"","handlingStrategy":"validation","validationCode":"const syntax = cfg.commentSyntax;\nif (syntax !== 'html' && syntax !== 'jsx') {\n  throw new TypeError(`config.commentSyntax must be 'html' or 'jsx' — got ${JSON.stringify(syntax)}`);\n}","typeGuard":"const isSupportedCommentSyntax = (v) => v === 'html' || v === 'jsx';","tryCatchPattern":null,"preventionTips":["The check is exact and case-sensitive: lowercase 'html' / 'jsx' only — no 'js', 'ts', 'tsx', or uppercase variants","For React/Next/JSX-in-.js projects use 'jsx'","Add a config lint step that whitelists the two literals"],"tags":["config","schema","comment-syntax","live-inject"],"backgroundTag":"config-schema-validation","analyzedSha":"f88b2837a7d7c3182e46307bbbb091a1ed547571","analyzedAt":"2026-08-18T04:58:36.608Z","contentChangedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}