@@ -550,9 +550,10 @@ describe("IgnoredPaths", () => {
550
550
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
551
551
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
552
552
assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
553
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
553
554
} ) ;
554
555
555
- it ( "should ignore default folders there is an ignore file without unignored defaults" , ( ) => {
556
+ it ( "should ignore default folders when there is an ignore file without unignored defaults" , ( ) => {
556
557
const cwd = getFixturePath ( ) ;
557
558
const ignoredPaths = new IgnoredPaths ( { ignore : true , ignorePath : getFixturePath ( ".eslintignore" ) , cwd } ) ;
558
559
@@ -564,6 +565,7 @@ describe("IgnoredPaths", () => {
564
565
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
565
566
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
566
567
assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
568
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
567
569
} ) ;
568
570
569
571
it ( "should not ignore things which are re-included in ignore file" , ( ) => {
@@ -578,8 +580,10 @@ describe("IgnoredPaths", () => {
578
580
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
579
581
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
580
582
assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
583
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
581
584
assert . isFalse ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
582
585
assert . isFalse ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
586
+ assert . isFalse ( shouldIgnore ( resolve ( ".hidden/package" ) ) ) ;
583
587
} ) ;
584
588
585
589
it ( "should ignore files which we try to re-include in ignore file when ignore option is disabled" , ( ) => {
@@ -594,8 +598,10 @@ describe("IgnoredPaths", () => {
594
598
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
595
599
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
596
600
assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
601
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
597
602
assert . isTrue ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
598
603
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
604
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/package" ) ) ) ;
599
605
} ) ;
600
606
601
607
it ( "should not ignore dirs which are re-included by ignorePattern" , ( ) => {
@@ -610,9 +616,21 @@ describe("IgnoredPaths", () => {
610
616
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
611
617
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
612
618
assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
619
+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
613
620
assert . isFalse ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
614
621
assert . isTrue ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
615
622
} ) ;
623
+
624
+ it ( "should not ignore hidden dirs when dotfiles is enabled" , ( ) => {
625
+ const cwd = getFixturePath ( "no-ignore-file" ) ;
626
+ const ignoredPaths = new IgnoredPaths ( { ignore : true , cwd, dotfiles : true } ) ;
627
+
628
+ const shouldIgnore = ignoredPaths . getIgnoredFoldersGlobChecker ( ) ;
629
+ const resolve = createResolve ( cwd ) ;
630
+
631
+ assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
632
+ assert . isFalse ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
633
+ } ) ;
616
634
} ) ;
617
635
618
636
} ) ;
0 commit comments