* Avoid printing comments on static fields twice.
In TS4.4, when a transformer adds a static field with a synthetic
comment to a decorated class, TS prints the synthetic comment twice:
@Decorator
class MyClass {
/* comment */ staticField = 'x'; // field and comment added by transformer
}
Becomes:
var MyClass = class MyClass {}
/*comment*/
/*comment*/
MyClass.newField = "x";
__decorate(MyClass, Decorator, ...)
This is because the classFields transformer calls `setOriginalNode(n,
propertyDeclaration)` on both the expression statement , and the
assignment expression contained in it, leading to the synthetic comment
appearing twice.
This change avoids the problem by explicitly deleting any synthetic
comments from the assignment expression created for static fields when
creating the expression statement containing the assignment. This allows
us to retain the information of the original node without printing the
synthetic comment twice.
* Update src/testRunner/unittests/transform.ts
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* Have auto-import provider pull in `exports`
* Revert filtering of node_modules relative paths, to do in separate PR
* Do @types and JS prioritization correctly
* Cache entrypoints on PackageJsonInfo
* Add one more test
* Delete unused function
* Fix other tests - dependencies need package.json files
* Do two passes of exports resolution
* Fix missed refactor
* Apply suggestions from code review
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Uncomment rest of test
* Handle array targets
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Type { [P in K]: E }[X] has constraint E with X substutited for P
* Add regression test
* Fix PragmaMap and ReadonlyPragmaMap declarations
* Explore additional constraint
* Revert previous change
* Add tests
ATA tried to use the `_requiredBy` field to determine toplevel deps,
but this is not portable. Not only is it unavailable in npm@>=7, but
neither Yarn nor pnpm write this metadata to node_modules pkgjsons.
This also adds support for ATA acquiring types for scoped packages.
Fixes: https://github.com/microsoft/TypeScript/issues/44130
* Use node ipc for TS Server
For #46417
This lets us use Node's built-in ipc for passing messages to/from the typescript server instead of using stdio
* Remove extra parse
* Add extra logging when using node IPC
* Split out to subclass
* Extract common writeMessage method
* Baseline accept
* Discourage typo fixes in PR template
Wording taken from [this comment](https://github.com/microsoft/TypeScript/pull/45834#issuecomment-919606286).
There have been a number of rejected typo fix PRs lately; hopefully this can reduce the amount of typo-fix-rejecting work for the team.
* Tweak typo fix discouragement in PR template
Removed "the same generally applies to other projects" per orta
* Update typo fix discouragement