(rootDir: string)
| 650 | * opt-in). |
| 651 | */ |
| 652 | export function buildDefaultIgnore(rootDir: string): Ignore { |
| 653 | const ig = ignore().add(DEFAULT_IGNORE_PATTERNS); |
| 654 | const projectRules = ignore(); |
| 655 | const rootGitignore = path.join(rootDir, '.gitignore'); |
| 656 | if (fs.existsSync(rootGitignore)) { |
| 657 | const patterns = readGitignorePatterns(rootGitignore); |
| 658 | ig.add(patterns); |
| 659 | projectRules.add(patterns); |
| 660 | } |
| 661 | const extra = readGitExcludeExtraPatterns(rootDir); |
| 662 | if (extra) { |
| 663 | ig.add(extra); |
| 664 | projectRules.add(extra); |
| 665 | } |
| 666 | return excludeBuildOutputUnderSrc(ig, projectRules); |
| 667 | } |
| 668 | |
| 669 | /** |
| 670 | * Defaults-only ignore matcher (no root `.gitignore` merged). Used wherever the |
no test coverage detected