Description
On Unixy platforms, tsc should by default not attempt to compile files that begin with a dot (hereafter called "hidden files"). These files are intended to be hidden, and in practice any file that has a name like .foo.ts
is always a temporary file written by an editor while saving.
Currently, when you run tsc --watch
in a directory and hit save in emacs, tsc picks up the hidden temporary file and attempts to compile it, resulting in duplicate definition errors (between the temporary file and the real source file). And it's surprisingly annoying to work around this problem -- you can't use a glob in your tsconfig.json
excludes
section, so you instead must enumerate each source file in a files
section.
It is pretty standard on Unixes to ignore hidden files. For example the shell "*" ignores hidden files by default, as seen in the output of commands like ls *
.
I cannot think of any circumstance where someone would want to bring in a hidden file to their compilation, but if they did perhaps they could do so manually via the files
section -- it's definitely the sort of thing you ought to need to opt in to.