@@ -199,3 +199,40 @@ test('prettier rules are applied after react rules', t => {
199
199
200
200
t . is ( getJsRule ( flatConfig , 'react/jsx-tag-spacing' ) , 'off' ) ;
201
201
} ) ;
202
+
203
+ test ( 'global ignores are respected' , t => {
204
+ const flatConfig = xoToEslintConfig ( [
205
+ { ignores : [ '**/test' ] } ,
206
+ ] ) ;
207
+
208
+ t . deepEqual ( flatConfig . at ( - 1 ) , { ignores : [ '**/test' ] } ) ;
209
+ } ) ;
210
+
211
+ test ( 'global ignores as strings are respected' , t => {
212
+ const flatConfig = xoToEslintConfig ( [
213
+ { ignores : '**/test' } ,
214
+ ] ) ;
215
+
216
+ t . deepEqual ( flatConfig . at ( - 1 ) , { ignores : [ '**/test' ] } ) ;
217
+ } ) ;
218
+
219
+ test ( 'global ignores with names are respected' , t => {
220
+ const flatConfig = xoToEslintConfig ( [
221
+ { name : 'test-ignores' , ignores : '**/test' } ,
222
+ ] ) ;
223
+
224
+ t . deepEqual ( flatConfig . at ( - 1 ) , { name : 'test-ignores' , ignores : [ '**/test' ] } ) ;
225
+ } ) ;
226
+
227
+ test ( 'empty configs are filtered' , t => {
228
+ const flatConfig = xoToEslintConfig ( [
229
+ { name : 'test-ignores' , ignores : '**/test' } ,
230
+ { } ,
231
+ { } ,
232
+ { } ,
233
+ { rules : { } } ,
234
+ ] ) ;
235
+
236
+ t . deepEqual ( flatConfig . at ( - 1 ) , { files : [ allFilesGlob ] , rules : { } } ) ;
237
+ t . deepEqual ( flatConfig . at ( - 2 ) , { name : 'test-ignores' , ignores : [ '**/test' ] } ) ;
238
+ } ) ;
0 commit comments