@@ -491,19 +491,12 @@ impl LintRunner {
491491 // when no file is found, the default configuration is returned
492492 fn find_oxlint_config ( cwd : & Path , config : Option < & PathBuf > ) -> Result < Oxlintrc , OxcDiagnostic > {
493493 let path: & Path = config. map_or ( Self :: DEFAULT_OXLINTRC . as_ref ( ) , PathBuf :: as_ref) ;
494- match ( absolute ( cwd. join ( path) ) , config) {
495- // Config file exists, either explicitly provided or the default file name
496- // Parse the config file and return it, or report an error if parsing fails
497- ( Ok ( full_path) , _) => Oxlintrc :: from_file ( & full_path) ,
498- // Failed to resolve config, and it was explicitly provided
499- // Return that the config file could not be found
500- ( Err ( e) , Some ( config_path) ) => Err ( OxcDiagnostic :: error ( format ! (
501- "Failed to resolve config path {}: {e}" ,
502- config_path. display( )
503- ) ) ) ,
504- // Failed to resolve implicit path, return default config
505- _ => Ok ( Oxlintrc :: default ( ) ) ,
494+ let full_path = cwd. join ( path) ;
495+
496+ if config. is_some ( ) || full_path. exists ( ) {
497+ return Oxlintrc :: from_file ( & full_path) ;
506498 }
499+ Ok ( Oxlintrc :: default ( ) )
507500 }
508501
509502 /// Looks in a directory for an oxlint config file, returns the oxlint config if it exists
0 commit comments