import minimatch from "minimatch" ; import prettier from "prettier" ; export function applyConfigOverrides ( config , filename ) { if ( ! config . overrides ) { return config ; } const result = { ... config } ; for ( const override of config . overrides ) { const globs = typeof override . files === "string" ? [ override . files ] : override . files ; for ( const glob of globs ) { if ( minimatch ( filename , glob ) ) { for ( const [ key , value ] of Object . entries ( override . options ) ) { result [ key ] = value ; } } } } delete result . overrides ; return result ; }