I advocated against immediately clearing the console when starting --watch in #17756 because it was confusing to have the console suddenly become blank, wait a while, and _then_ give output. After using the feature for a little while, I think it's a little disorienting how the console will only start clearing after the first recompile. This change clears the console and immediately prints a new "Starting compilation in watch mode..." message.
Timestamps look like Gulp's, with grey times inside white brackets.
Files have cyan filenames, yellow line and column numbers, and grey TS{####} errors. I wonder if those are actually useful for folks using the --pretty CLI: are they used for anything outside Visual Studio... Can we just get rid of them?
Re-uses compiler/program's color logic in compiler/watch. The relevant variables are now exported and marked `@internal`. Is there a preferred way of re-using this code in both those files?
* tsc --watch should clear screen on new compilation
* added optional clearScreen method to System]
* implemented via `x1Bc`, reset screen
* fixes 13020
* Feedback on if statements; api .d.ts baseline additions
* Stopped clearing screen in tsc.js's reportWatchMode
* Added unit tests
* Still instantiate the extends clause even when theres a noimplicitany error in js
* Only be permissive for JS
* In JS, instantiate classes even when they have too many type arguments, instead of returning unknownType
* Fix#19959 and #19958: Remove un-localizable messages
* Update message
* Reorder error messages
* Fix https://github.com/Microsoft/TypeScript/issues/15399: remove periods at the end of messages
* Accept baselines for error code changes
* accept baselines for removed periods
* Update diagnostic messages
Previously, when inferring to a self-referential (or otherwise recursive)
homomorphic mapped type from a source type that also has recursive
references, type inference would enter infinite recursion.
Now there is a more complex stack for mapped type inference. It mirrors
the existing symbolStack but (1) includes the source type and (2) is
passed through inferTypeForHomomorphicMappedType, which is actually
called outside of inferTypes, and so restarts the symbolStack cache
every time.