* 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)
| 258 | * `.gitignore` line would. |
| 259 | */ |
| 260 | function extractIncludeIgnored(parsed: object, file: string): string[] { |
| 261 | const raw = (parsed as ProjectConfig).includeIgnored; |
| 262 | if (raw === undefined) return []; |
| 263 | if (!Array.isArray(raw)) { |
| 264 | logWarn(`Ignoring "includeIgnored" in ${PROJECT_CONFIG_FILENAME}: must be an array of gitignore-style patterns`, { file }); |
| 265 | return []; |
| 266 | } |
| 267 | |
| 268 | const out: string[] = []; |
| 269 | for (const entry of raw) { |
| 270 | if (typeof entry !== 'string' || !entry.trim()) { |
| 271 | logWarn(`Ignoring an "includeIgnored" entry in ${PROJECT_CONFIG_FILENAME}: every pattern must be a non-empty string`, { file }); |
| 272 | continue; |
| 273 | } |
| 274 | out.push(entry.trim()); |
| 275 | } |
| 276 | return out; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Validate a gitignore-style pattern list under `key`. A non-array value or a |
no test coverage detected