Skip to content

Commit

Permalink
fix: empty exclude value in option file badly handled (#4546)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkm authored and mattgodbolt committed Jan 24, 2023
1 parent 5a0b415 commit 4491437
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tooling/base-tool.ts
Expand Up @@ -73,6 +73,12 @@ export class BaseTool implements ITool {
}
// Even if the include key is truthy, we fall back to the exclusion list.
}

// an empty value (e.g. 'tool.foo.exclude=') yields a single empty
// string in the array, not an empty array.
if (this.tool.exclude.length === 1 && this.tool.exclude[0] === '')
return false;

return this.tool.exclude.find(excl => compilerId.includes(excl)) !== undefined;
}

Expand Down

0 comments on commit 4491437

Please sign in to comment.