{"record":{"id":"6e7efe234df6bf5b","repo":"pbakaus/impeccable","slug":"config-exclude-must-contain-only-non-empty-strings","errorCode":null,"errorMessage":"config.exclude must contain only non-empty strings","messagePattern":"config\\.exclude must contain only non-empty strings","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/live-inject.mjs","lineNumber":462,"sourceCode":"\n// ---------------------------------------------------------------------------\n// Core operations\n// ---------------------------------------------------------------------------\n\nfunction validateConfig(cfg) {\n  if (!cfg || typeof cfg !== 'object') throw new Error('config.json must be an object');\n  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];","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/live-inject.mjs#L444-L480","documentation":"Follow-up check for cfg.exclude: when the array is present, every element must be a non-empty string. An exclude array containing '' or a non-string value throws. Same generation pitfalls as empty files entries, but on the optional filter list.","triggerScenarios":"\"exclude\": [\"dist\", \"\"] — trailing empty from a split/join pipeline, or a null/number element inside the array.","commonSituations":"Programmatically assembled exclude lists that don't filter blanks; template placeholders left in; merging configs where an entry was deleted but left an empty slot.","solutions":["Drop empty/non-string entries from exclude so each item is a non-empty string","Filter generated lists before writing: excludes.filter((p) => typeof p === 'string' && p.trim())","Alternatively delete the exclude key — it is optional"],"exampleFix":"// before\n\"exclude\": [\"dist\", \"\"]\n\n// after\n\"exclude\": [\"dist\"]","handlingStrategy":"validation","validationCode":"const ok = cfg.exclude === undefined\n  || (Array.isArray(cfg.exclude) && cfg.exclude.every((f) => typeof f === 'string' && f.length > 0));\nif (!ok) throw new TypeError('config.exclude entries must be non-empty strings');","typeGuard":"const hasCleanExcludeEntries = (cfg) =>\n  cfg.exclude === undefined\n  || (Array.isArray(cfg.exclude) && cfg.exclude.every((f) => typeof f === 'string' && f.trim() !== ''));","tryCatchPattern":null,"preventionTips":["Apply the same blank-filtering to exclude as to files when generating configs","Delete rather than blank out unwanted entries","Re-run `--check` after programmatic config edits"],"tags":["config","schema","exclude","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"}