* Validate the `includeIgnored` patterns: an array of non-empty gitignore-style * strings. A non-array value or a non-string/blank entry warns-and-skips; never * throws. Patterns are kept verbatim (trimmed) so they match exactly as a * `.gitignore` line would.
(parsed: object, file: string)
| 211 | * `.gitignore` line would. |
| 212 | */ |
| 213 | function extractIncludeIgnored(parsed: object, file: string): string[] { |
| 214 | const raw = (parsed as ProjectConfig).includeIgnored; |
| 215 | if (raw === undefined) return []; |
| 216 | if (!Array.isArray(raw)) { |
| 217 | logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 218 | return []; |
| 219 | } |
| 220 | |
| 221 | const out: string[] = []; |
| 222 | for (const entry of raw) { |
| 223 | if (typeof entry !== 'string' || !entry.trim()) { |
| 224 | logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 225 | continue; |
| 226 | } |
| 227 | out.push(entry.trim()); |
| 228 | } |
| 229 | return out; |
| 230 | } |
| 231 | |
| 232 | /** |
| 233 | * Validate a gitignore-style pattern list under `key`. A non-array value or a |
no test coverage detected