{"record":{"id":"4c05b321b9154e69","repo":"pbakaus/impeccable","slug":"config-commentsyntax-must-be-html-or-jsx-4c05b3","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/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/live-inject.mjs#L451-L487","documentation":"Thrown by validateConfig() in live-inject.mjs when cfg.commentSyntax is neither 'html' nor 'jsx'. The injector wraps the inserted snippet in a comment marker so it can find and remove it on cleanup; the two supported comment styles map to <!-- --> for HTML and {/* */} for JSX/TSX/Svelte. Any other value (including undefined, since the check has no default) is rejected.","triggerScenarios":"validateConfig runs on a config whose 'commentSyntax' is missing, misspelled ('JSX', 'HTML', 'tsx', 'svelte'), or set to an unsupported value like 'css'.","commonSituations":"User omits commentSyntax assuming a default; uses uppercase variant; targets .svelte/.astro files and guesses 'svelte'; upgrades the tool and a previously-lenient value is now strict.","solutions":["Set 'commentSyntax' to 'html' for .html/.astro templates or 'jsx' for .jsx/.tsx/.svelte files.","If targeting mixed file types, split into two configs (one per commentSyntax) since a single config supports only one style.","Double-check spelling and casing — only the exact lowercase tokens 'html' and 'jsx' pass."],"exampleFix":"// before\n\"commentSyntax\": \"HTML\"\n// after\n\"commentSyntax\": \"html\"","handlingStrategy":"validation","validationCode":"if (!['html', 'jsx'].includes(cfg.commentSyntax)) {\n  throw new Error(`commentSyntax must be 'html' or 'jsx', got ${JSON.stringify(cfg.commentSyntax)}`);\n}","typeGuard":"function isCommentSyntax(v: unknown): v is 'html' | 'jsx' {\n  return v === 'html' || v === 'jsx';\n}","tryCatchPattern":null,"preventionTips":["Pin commentSyntax explicitly in every config — never rely on a default.","Split mixed file-type targets into one config per commentSyntax.","Use lowercase literal tokens only; treat any tool that uppercases them as buggy."],"tags":["config","validation","live-inject","comment-syntax"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}