@@ -550,9 +550,10 @@ describe("IgnoredPaths", () => {
550550 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
551551 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
552552 assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
553+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
553554 } ) ;
554555
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" , ( ) => {
556557 const cwd = getFixturePath ( ) ;
557558 const ignoredPaths = new IgnoredPaths ( { ignore : true , ignorePath : getFixturePath ( ".eslintignore" ) , cwd } ) ;
558559
@@ -564,6 +565,7 @@ describe("IgnoredPaths", () => {
564565 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
565566 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
566567 assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
568+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
567569 } ) ;
568570
569571 it ( "should not ignore things which are re-included in ignore file" , ( ) => {
@@ -578,8 +580,10 @@ describe("IgnoredPaths", () => {
578580 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
579581 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
580582 assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
583+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
581584 assert . isFalse ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
582585 assert . isFalse ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
586+ assert . isFalse ( shouldIgnore ( resolve ( ".hidden/package" ) ) ) ;
583587 } ) ;
584588
585589 it ( "should ignore files which we try to re-include in ignore file when ignore option is disabled" , ( ) => {
@@ -594,8 +598,10 @@ describe("IgnoredPaths", () => {
594598 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
595599 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
596600 assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
601+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
597602 assert . isTrue ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
598603 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
604+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/package" ) ) ) ;
599605 } ) ;
600606
601607 it ( "should not ignore dirs which are re-included by ignorePattern" , ( ) => {
@@ -610,9 +616,21 @@ describe("IgnoredPaths", () => {
610616 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a" ) ) ) ;
611617 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/a/b" ) ) ) ;
612618 assert . isFalse ( shouldIgnore ( resolve ( ".hidden" ) ) ) ;
619+ assert . isTrue ( shouldIgnore ( resolve ( ".hidden/a" ) ) ) ;
613620 assert . isFalse ( shouldIgnore ( resolve ( "node_modules/package" ) ) ) ;
614621 assert . isTrue ( shouldIgnore ( resolve ( "bower_components/package" ) ) ) ;
615622 } ) ;
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+ } ) ;
616634 } ) ;
617635
618636} ) ;
0 commit comments