@@ -1102,7 +1102,7 @@ describe("FlatESLint", () => {
11021102 } ) ;
11031103
11041104 // https://github.com/eslint/eslint/issues/16354
1105- it ( "should skip subdirectory files when ignore pattern matches subdirectory" , async ( ) => {
1105+ it ( "should skip subdirectory files when ignore pattern matches deep subdirectory" , async ( ) => {
11061106 eslint = new FlatESLint ( {
11071107 cwd : getFixturePath ( "ignores-directory" )
11081108 } ) ;
@@ -1124,6 +1124,34 @@ describe("FlatESLint", () => {
11241124
11251125 } ) ;
11261126
1127+ // https://github.com/eslint/eslint/issues/16414
1128+ it ( "should skip subdirectory files when ignore pattern matches subdirectory" , async ( ) => {
1129+ eslint = new FlatESLint ( {
1130+ cwd : getFixturePath ( "ignores-subdirectory" )
1131+ } ) ;
1132+
1133+ await assert . rejects ( async ( ) => {
1134+ await eslint . lintFiles ( [ "subdir/**/*.js" ] ) ;
1135+ } , / A l l f i l e s m a t c h e d b y ' s u b d i r \/ \* \* \/ \* \. j s ' a r e i g n o r e d \. / u) ;
1136+
1137+ const results = await eslint . lintFiles ( [ "subdir/subsubdir/a.js" ] ) ;
1138+
1139+ assert . strictEqual ( results . length , 1 ) ;
1140+ assert . strictEqual ( results [ 0 ] . filePath , getFixturePath ( "ignores-subdirectory/subdir/subsubdir/a.js" ) ) ;
1141+ assert . strictEqual ( results [ 0 ] . warningCount , 1 ) ;
1142+ assert ( results [ 0 ] . messages [ 0 ] . message . startsWith ( "File ignored" ) , "Should contain file ignored warning" ) ;
1143+
1144+ eslint = new FlatESLint ( {
1145+ cwd : getFixturePath ( "ignores-subdirectory/subdir" )
1146+ } ) ;
1147+
1148+ await assert . rejects ( async ( ) => {
1149+ await eslint . lintFiles ( [ "subsubdir/**/*.js" ] ) ;
1150+ } , / A l l f i l e s m a t c h e d b y ' s u b s u b d i r \/ \* \* \/ \* \. j s ' a r e i g n o r e d \. / u) ;
1151+
1152+
1153+ } ) ;
1154+
11271155 // https://github.com/eslint/eslint/issues/16340
11281156 it ( "should lint files even when cwd directory name matches ignores pattern" , async ( ) => {
11291157 eslint = new FlatESLint ( {
0 commit comments