@@ -1101,7 +1101,6 @@ describe("FlatESLint", () => {
11011101 assert . strictEqual ( results [ 0 ] . filePath , getFixturePath ( "ignores-relative/subdir/a.js" ) ) ;
11021102 } ) ;
11031103
1104-
11051104 // https://github.com/eslint/eslint/issues/16354
11061105 it ( "should skip subdirectory files when ignore pattern matches subdirectory" , async ( ) => {
11071106 eslint = new FlatESLint ( {
@@ -1140,6 +1139,47 @@ describe("FlatESLint", () => {
11401139
11411140 } ) ;
11421141
1142+ // https://github.com/eslint/eslint/issues/16416
1143+ it ( "should allow reignoring of previously ignored files" , async ( ) => {
1144+ eslint = new FlatESLint ( {
1145+ cwd : getFixturePath ( "ignores-relative" ) ,
1146+ overrideConfigFile : true ,
1147+ overrideConfig : {
1148+ ignores : [
1149+ "*.js" ,
1150+ "!a*.js" ,
1151+ "a.js"
1152+ ]
1153+ }
1154+ } ) ;
1155+ const results = await eslint . lintFiles ( [ "a.js" ] ) ;
1156+
1157+ assert . strictEqual ( results . length , 1 ) ;
1158+ assert . strictEqual ( results [ 0 ] . errorCount , 0 ) ;
1159+ assert . strictEqual ( results [ 0 ] . warningCount , 1 ) ;
1160+ assert . strictEqual ( results [ 0 ] . filePath , getFixturePath ( "ignores-relative/a.js" ) ) ;
1161+ } ) ;
1162+
1163+ // https://github.com/eslint/eslint/issues/16415
1164+ it ( "should allow directories to be unignored" , async ( ) => {
1165+ eslint = new FlatESLint ( {
1166+ cwd : getFixturePath ( "ignores-directory" ) ,
1167+ overrideConfigFile : true ,
1168+ overrideConfig : {
1169+ ignores : [
1170+ "subdir/*" ,
1171+ "!subdir/subsubdir"
1172+ ]
1173+ }
1174+ } ) ;
1175+ const results = await eslint . lintFiles ( [ "subdir/**/*.js" ] ) ;
1176+
1177+ assert . strictEqual ( results . length , 1 ) ;
1178+ assert . strictEqual ( results [ 0 ] . errorCount , 0 ) ;
1179+ assert . strictEqual ( results [ 0 ] . warningCount , 0 ) ;
1180+ assert . strictEqual ( results [ 0 ] . filePath , getFixturePath ( "ignores-directory/subdir/subsubdir/a.js" ) ) ;
1181+ } ) ;
1182+
11431183
11441184 } ) ;
11451185
0 commit comments