* Alias for `module.exports.x = x`
This fixes#40155 in a surprisingly small amount of code.
* Treat any aliasable expression as an alias
* test internal references to exported class
* Always export typedefs
This actually just required deleting a check in declareModuleMembers
and checking for external AND commonjs modules in a couple of places.
However, while experimenting with this feature, I discovered that even
previously-exported typedefs would only be exported if they came after a
commonjs export node. So I added a commonjs check to the pass in the
parser. It will not catch nested module.exports, but it will catch
top-level assignments.
The new test tests both changes.
* Post-bind typedef instead of pre-checking for commonjs
* Duplicate identifier errors
* Fix class type reference resolution+update baselines
* Move to a type-based check for duplicate identifiers
* Print js-constructor function type names
Instead of printing them as a type literal, which is scary.
* Use assigned name for functions and classes
That otherwise have no name. This helps quick info for javascript a
*lot*. Typescript mainly benefits when printing the type of class
expressions.
* Improve names of functions in binding elements
Also fix some fourslash baselines