33562 Commits

Author SHA1 Message Date
Daniel Rosenwasser
ed014db864
Add names for refactoring functions. (#47375)
* Add names for refactoring functions.

* Consistency in function names.
2022-01-11 12:20:17 -08:00
Martin Probst
faee7b3621
Avoid printing comments on static fields twice. (#47363)
* 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>
2022-01-11 12:19:36 -08:00
Andrew Branch
0f1496f354
Process package.json exports with auto-import provider (#47092)
* 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>
2022-01-11 11:10:35 -08:00
Orta Therox
935c05cf34
Fix the related repos CI (#47386) 2022-01-11 15:27:51 +00:00
Anders Hejlsberg
4d6dd119d5
Add missing mapped type indexed access constraint (#47370)
* 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
2022-01-11 07:23:18 -08:00
Andrew Branch
852b1c2b73
Fix checker initialization crash with esModuleInterop and global merges resolving to ImportEquals aliases (#47348)
* Add minimal failing test

* Fix checker initialization crash with esModuleInterop global merges resolving to ImportEquals aliases
2022-01-10 16:04:12 -08:00
TypeScript Bot
337bbcccbe Update package-lock.json 2022-01-10 06:07:07 +00:00
TypeScript Bot
b53073bf66 Update package-lock.json 2022-01-08 06:07:09 +00:00
Kat Marchán
7f189b9701
fix ATA toplevel dep detection (#47164)
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
2022-01-07 13:48:31 -08:00
Orta Therox
8a8c71c147
Use relative paths for the end of compile report (#47344) 2022-01-07 19:55:55 +00:00
Oleksandr T
6fc0584dd5
fix(46402): create valid property keys/jsx attribute names (#46716) 2022-01-07 11:46:26 -08:00
Jake Bailey
484f1414d6
Prevent merged class/namespace from overlapping with Record<string, unknown> (#47088) 2022-01-07 11:02:48 -08:00
Anders Hejlsberg
a3d23d36cc
Fix conditional type constraint exploration + signature relations (#47341) 2022-01-07 07:44:57 -10:00
Kagami Sascha Rosylight
363e3a78f4
Add Error.prototype.cause (#47020)
* Add `Error.prototype.cause`

Fixes #47019

* Update test baselines
2022-01-07 14:58:58 +00:00
Orta Therox
e46f3baec1
Adds a github actions workflow which pings related repos with a blank commit once a month to ensure their automation stays running (#46747) 2022-01-07 13:37:16 +00:00
Alka Vats
0fcd86150e
docs(common): url link format updated (#47336)
fix the url link format from http to https
2022-01-06 22:08:19 +00:00
TypeScript Bot
95d8921641 Update package-lock.json 2022-01-06 06:07:15 +00:00
Matt Bierner
69662090a3
Use node ipc for TS Server (#46418)
* 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
2022-01-05 16:39:45 -08:00
TypeScript Bot
e10c912bf6 Update package-lock.json 2022-01-05 06:06:57 +00:00
Gabriela Araujo Britto
404a7d602d
Gabritto/semicolons (#46832)
* call formatter in completions

* fixes

* add test

* update api baselines

* fix createModifiersFromModifierFlag to not return empty array
2022-01-04 11:50:49 -08:00
Anders Hejlsberg
f4e1efbc29
Control flow analysis for dependent parameters (#47190)
* Support control flow analysis for dependent parameters

* Add tests
2022-01-04 09:22:11 -10:00
TypeScript Bot
2f058b72d6 Update package-lock.json 2022-01-04 06:06:11 +00:00
gfyoung
9a75d2acc8
fix(46845): Add missing "locale" field to Intl.DisplayNamesOptions (#46849)
Closes https://github.com/microsoft/TypeScript/issues/46845
2022-01-03 20:10:20 +00:00
TypeScript Bot
db9e007900 Update package-lock.json 2022-01-02 06:06:34 +00:00
TypeScript Bot
ef9fd97e4d Update package-lock.json 2021-12-27 06:06:35 +00:00
TypeScript Bot
fdbe371b12 Update package-lock.json 2021-12-24 06:06:15 +00:00
tjjfvi
5cab95150a
Discourage typo fixes in PR template (#46908)
* 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
2021-12-23 14:58:23 +00:00
TypeScript Bot
afce88ec50 Update package-lock.json 2021-12-23 06:06:14 +00:00
TypeScript Bot
25fc025f50 Update package-lock.json 2021-12-21 06:06:27 +00:00
TypeScript Bot
d7b49238ea Update package-lock.json 2021-12-20 06:06:43 +00:00
TypeScript Bot
7433b0c6d0 Update package-lock.json 2021-12-19 06:06:07 +00:00
Nathan Shively-Sanders
8a5d476ec9
Fix baselines from bad merge (#47177)
Conflict between #47018 and #46824, both of which changed the behaviour of private fields.
2021-12-17 12:15:08 -08:00
Zzzen
a42379179b
fix merging of function and derived class (#47170) 2021-12-16 17:29:07 -08:00
Kagami Sascha Rosylight
20e86dab5b
Emit class fields as-is with target: es2022 (#47018)
* Emit class fields as-is with `target: es2022`

Closes #47017

* wave 2
2021-12-16 15:15:33 -08:00
Oleksandr T
c282771d59
fix(47004): ignore arguments name in PropertyAssignment (#47054) 2021-12-16 13:05:48 -08:00
Oleksandr T
93bdfd2511
fix(47056): report errors for all properties with errors (#47057) 2021-12-16 12:58:15 -08:00
Andrew Nguyen
270b0d1c73
fix(46824): remove duplicate private identifier errors (#47116) 2021-12-16 12:07:12 -08:00
TypeScript Bot
34e897457a Update package-lock.json 2021-12-16 06:06:21 +00:00
Tao Cumplido
2bbdb31b07
update es2020.intl DisplayNames#of (#47157)
fix return type of Intl.DisplayNames.prototype.of
was typed to return always string but can actually return undefined too
see spec https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of
2021-12-15 17:51:35 +00:00
TypeScript Bot
f21e1a6e9d Update package-lock.json 2021-12-15 06:06:11 +00:00
Anders Hejlsberg
3d3825e783
Fix multiple issues with indexed access types applied to mapped types (#47109)
* Fix multiple issues with indexed access types applied to mapped types

* Add tests
2021-12-14 11:51:03 -08:00
LowR
7e0e8671fa
fix(47134): show all meanings for type-only imports and exports (#47138) 2021-12-14 10:58:21 -08:00
Hiroshi Ogawa
8974fead2d
fix(47062): support generic arrow function with default type parameter in tsx (#47112)
* fix(47062): support generic arrow function with default type parameter in tsx

* test: update test "completionListIsGlobalCompletion"
2021-12-14 09:02:36 -08:00
Armando Aguirre
67872a50d0
Fix enums and namespace merge (#47059)
* Fix enums and namespace merge

* Remove unused comment
2021-12-13 14:03:19 -08:00
Andrew Branch
430599722e
Fix extract type crash (#47136) 2021-12-13 10:39:34 -08:00
Anders Hejlsberg
06746efbd9
Revert change to getFalsyFlags (#47125)
* Revert change to getFalsyFlags

* Add regression test
2021-12-13 09:05:55 -08:00
TypeScript Bot
d4170586f0 Update package-lock.json 2021-12-11 06:06:53 +00:00
Oleksandr T
df87a8c12d
fix(44693): emit declaration of JSDoc overridden properties with different types (#46797) 2021-12-10 11:06:59 -08:00
Jake Bailey
4e39023396
Enable customDescriptionGenerator in launch template, update eslint setting (#47089) 2021-12-09 11:47:12 -08:00
Jake Bailey
0ed9247e17
Explicitly Omit unspreadable properties from rest type in the generic case (#47078) 2021-12-09 11:45:52 -08:00