{"record":{"id":"093cc6ba21c0cc17","repo":"oxc-project/oxc","slug":"ts5112","errorCode":"TS5112","errorMessage":"tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.","messagePattern":"tsconfig\\.json is present but will not be loaded if files are specified on commandline\\. Use '--ignoreConfig' to skip this error\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/oxc_type_checker/src/execute/tsc.rs","lineNumber":103,"sourceCode":"                // TS5081\n                bail!(\n                    \"Cannot find a tsconfig.json file at the current directory: {}.\",\n                    config_file.display()\n                );\n            }\n        } else if file_or_directory.exists() {\n            // An explicit config file (need not be named `tsconfig.json`).\n            Ok(Some(file_or_directory))\n        } else {\n            // TS5058\n            bail!(\"The specified path does not exist: '{}'.\", file_or_directory.display());\n        }\n    } else if let Some(config_file) = find_config_file(cwd) {\n        if command.files.is_empty() {\n            Ok(Some(config_file))\n        } else {\n            // TS5112: a tsconfig.json is present but source files were also specified.\n            bail!(\n                \"tsconfig.json is present but will not be loaded if files are specified on \\\n                 commandline. Use '--ignoreConfig' to skip this error.\"\n            );\n        }\n    } else if command.files.is_empty() {\n        // TS5081 — `tsc` prints version + help here; we report the missing config instead.\n        bail!(\"Cannot find a tsconfig.json file at the current directory: {}.\", cwd.display());\n    } else {\n        // Source files with no config file anywhere: compile them directly.\n        Ok(None)\n    }\n}\n\n/// Search `dir` and its ancestors for a `tsconfig.json`, mirroring tsgo's `findConfigFile`\n/// (`tspath.ForEachAncestorDirectory`).\nfn find_config_file(dir: &Path) -> Option<PathBuf> {\n    dir.ancestors()\n        .map(|ancestor| ancestor.join(\"tsconfig.json\"))","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_type_checker/src/execute/tsc.rs#L85-L121","documentation":"tsc error TS5058, raised in resolve_config_file when the --project argument resolves (relative to cwd) to neither an existing file nor an existing directory. The path is checked with exists() after the is_dir() branch, so this fires only for a completely missing filesystem path.","triggerScenarios":"Thrown at crates/oxc_type_checker/src/execute/tsc.rs:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the path spelling and whether it should be relative to the current working directory or absolute","Create the missing tsconfig file or directory","Pass --ignoreConfig if no config file should be loaded"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}