Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow tsconfig.json when input files are specified

See original GitHub issue

I don’t know why the tsconfig.json is ignored even when the --project or -p option is specified. In my opinion, the right implementation should be:

  • If no --project or -p option: Ignore tsconfig.json
  • Otherwise: Use the configuration file specified. All the options used in the command line should overwrite the ones of the configuration file. E.g. The include/exclude keys of the tsconfig.json will be ignored when input files are specified.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:541
  • Comments:39 (9 by maintainers)

github_iconTop GitHub Comments

brapifracommented, Feb 16, 2019

A pretty common practice is to have a pre-commit hook to compile only the staged files in your git project (It makes no sense to compile all the project). If you try to create this hook that runs tsc over each staged file, you won’t be able to use the tsconfig.json, as you are specifying some input files. @andy-ms

JasonKazcommented, May 25, 2019

I have a different use case that needs this as well. We have a pre-commit hook that does a quick type check (tsc -p tsconfig.json --noEmit). Currently it checks all the files specified in tsconfig.json, but it would be nice to only type check the files that were modified. We are currently using lint-staged to run linting tools on modified files, it would be great to only run the type check on the modified files too.

Like @brapifra said here,, it’s written in the docs that this should be possible, but it clearly isn’t.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - What is a tsconfig.json - TypeScript
command line option that specifies the path of a directory containing a tsconfig.json file, or a path to a valid .json file containing...
Read more >
tsconfig.json: Build:No inputs were found in config file
When you create the tsconfig.json file by tsc --init , then it comments the input and output file directory. So this is the...
Read more >
tsconfig.json - TypeScript - JavaScript that scales.
By invoking tsc with no input files and a --project (or just -p ) command line option that specifies the path of a...
Read more >
tsconfig.json - pkgsite - Git at Google
Visit to read more about this file */. /* Basic Options */ ... Specify the root directory of input files.
Read more >
tsconfig.json - GitHub
Overview The presence of a `tsconfig.json` file in a directory indicates that ... When input files are specified on the command line, `tsconfig.json`...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found