Allow tsconfig.json when input files are specified
See original GitHub issueI 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:
- Created 5 years ago
- Reactions:541
- Comments:39 (9 by maintainers)
Top 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 https://aka.ms/tsconfig.json 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
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 thetsconfig.json
, as you are specifying some input files. @andy-msI 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, https://github.com/microsoft/TypeScript/issues/27379#issuecomment-424879463, it’s written in the docs that this should be possible, but it clearly isn’t.