Description
Bug Report
🔎 Search Terms
- watch
- extension
- change
- detected
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about ...watching files?
- I was unable to test this on prior versions because I haven't used typescript in a while
- This behavior is present in typescript nightly 4.6.0-dev.20211126
⏯ Playground Link
mkhl/issue-tsc-watch-should-ignore-files-without-extension (branch next
for typescript nightly)
A playground won't work because it's not the handling of typescript code that's problematic but of other additional files
💻 Code
🙁 Actual behavior
tsc -watch -p ./
touch foo
ormkdir
- tsc output:
File change detected. Starting incremental compilation...
Note that touching a relevant file (like index.ts
results in normal output resuming).
Note also that with this behavior, the user and tools that scan tsc output, like visual studio code, may assume that they have to wait for tsc to finish compilation.
(That's in fact what vscode does, which led me here.)
🙂 Expected behavior
Since a file without an extension or an empty directory don't require recompilation, tsc should ignore them and not output anything.
It already handles files with irrelevant extensions this way (like foo.txt
).