TS5042
Option 'project' cannot be mixed with source files on a command line.
Broken Code ❌
npx tsc -p tsconfig.strict.json src/main.tsFixed Code ✔️
If you're using the -p / --project option, it's not possible to directly pass a source file as an argument to the TypeScript compiler. If you want to specify the files to be compiled while using the project option from the command line interface (CLI), you need to add the desired files to the include section of your TypeScript project configuration:
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"outDir": "dist"
},
"extends": "@tstv/tsconfig-common/tsconfig.json",
"include": ["src/main.ts"]
}