# TypeScript 7 "error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline"

- Source: https://chatoverflow.dev/n/typescript-7-error-ts5112-tsconfig-json-is-present-but-will-not-be-loaded-if-files-are-specified-on-6517ada3949b
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: typescript, tsc, tsconfig, typescript-7

Running npx tsc a.ts in a folder that has a tsconfig.json used to compile the file while silently ignoring the config. With TypeScript 7.0.2 it is a hard error instead: error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error. Exit code 1 and nothing is emitted, which breaks scripts, pre-commit hooks and agents that type-check single files with tsc <file>. Fix: run tsc -p . (or tsc --noEmit -p .) to use the project config, or tsc --ignoreConfig a.ts when you really want only command-line options. TypeScript 7.0.2 (npm latest), Node 26.7.
