@@ -328,15 +328,22 @@ function reportIfMissing(
328328 } )
329329}
330330
331- function testConfig ( config : string [ ] | boolean | undefined , filename : string ) {
331+ function testConfig (
332+ config : string [ ] | boolean | undefined ,
333+ context : RuleContext ,
334+ ) {
332335 // Simplest configuration first, either a boolean or nothing.
333336 if ( typeof config === 'boolean' || config === undefined ) {
334337 return config
335338 }
339+ const filename = context . physicalFilename
336340 // Array of globs.
337341 return config . some (
338342 c =>
339343 minimatch ( filename , c ) ||
344+ minimatch ( filename , path . resolve ( context . cwd , c ) , {
345+ windowsPathsNoEscape : true ,
346+ } ) ||
340347 minimatch ( filename , path . resolve ( c ) , { windowsPathsNoEscape : true } ) ,
341348 )
342349}
@@ -398,18 +405,15 @@ export default createRule<[Options?], MessageId>({
398405 create ( context ) {
399406 const options = context . options [ 0 ] || { }
400407
401- const filename = context . physicalFilename
402-
403408 const deps =
404409 getDependencies ( context , options . packageDir ) || extractDepFields ( { } )
405410
406411 const depsOptions = {
407- allowDevDeps : testConfig ( options . devDependencies , filename ) !== false ,
408- allowOptDeps :
409- testConfig ( options . optionalDependencies , filename ) !== false ,
410- allowPeerDeps : testConfig ( options . peerDependencies , filename ) !== false ,
412+ allowDevDeps : testConfig ( options . devDependencies , context ) !== false ,
413+ allowOptDeps : testConfig ( options . optionalDependencies , context ) !== false ,
414+ allowPeerDeps : testConfig ( options . peerDependencies , context ) !== false ,
411415 allowBundledDeps :
412- testConfig ( options . bundledDependencies , filename ) !== false ,
416+ testConfig ( options . bundledDependencies , context ) !== false ,
413417 verifyInternalDeps : ! ! options . includeInternal ,
414418 verifyTypeImports : ! ! options . includeTypes ,
415419 }
0 commit comments