-
Notifications
You must be signed in to change notification settings - Fork 13.4k
tsc should ignore hidden files by default #6861
Copy link
Copy link
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.tsis always a temporary file written by an editor while saving.Currently, when you run
tsc --watchin 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 yourtsconfig.jsonexcludessection, so you instead must enumerate each source file in afilessection.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
filessection -- it's definitely the sort of thing you ought to need to opt in to.