34031 Commits

Author SHA1 Message Date
ryohei.udagawa
c1c3ebcadf
fix: fractionalSecondDigits configure (#49014) 2022-05-09 15:24:24 -07:00
Oleksandr T
aa48a37e09
fix(48673): allow Find All References on access modifier for constructor (#48813) 2022-05-09 14:56:56 -07:00
James
d6e483b8da
fix(48887) exposing rest helper functions externally (#48888)
* fix(48887) exposing rest helper functions externally

* fixing baseline + adding hint about how to fix baseline

* Update src/harness/harnessIO.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-05-09 14:25:05 -07:00
Ron Buckton
e2bd89b309
Report error for invalid 'this' type during 'await' (#48946) 2022-05-09 13:58:36 -07:00
Andrew Branch
f3f0a3f394
Fix module specifier generation crash from typesVersions (#49035) 2022-05-09 12:48:24 -07:00
Wesley Wigham
f84ec3e8b4
Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters (#48861)
* Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters

* Less elaboration, non-strict-mode fix
2022-05-09 12:22:00 -07:00
David Souther
e9d39bd95f Remove spurious lookAhead, as this fn is already in a lookAhead 2022-05-09 10:53:58 -07:00
David Souther
958adfc9d8 Use all modifiers test 2022-05-09 10:41:02 -07:00
David Souther
3dd9ef43ce fix(44466): Fixes parsing contextual keyword casts as arrow functions 2022-05-09 10:22:22 -07:00
csigs
1071240907
LEGO: Merge pull request 49016
LEGO: Merge pull request 49016
2022-05-08 08:08:33 -07:00
csigs
53343dd94d
LEGO: Merge pull request 49010
LEGO: Merge pull request 49010
2022-05-07 05:42:49 -07:00
TypeScript Bot
bc161c0dd8 Update package-lock.json 2022-05-07 06:06:49 +00:00
Daniel Rosenwasser
94391dc9b5 Bump version to 4.8. 2022-05-07 00:22:34 +00:00
Ryan Cavanaugh
1a4643bdce
Flag resolution mode assertions in non-nightly builds (#49002)
* Flag resolution mode assertions in non-nightly builds

* Add checker check
2022-05-06 16:31:40 -07:00
Jake Bailey
8d0393d227
Fix missing parsingContext restore at return in parseDelimitedList (#48999) 2022-05-06 13:36:27 -07:00
Andrew Branch
2ffe6864b1
Respect importModuleSpecifierEnding inside node_modules packages (#48995)
* Respect importModuleSpecifierEnding inside node_modules packages

* Add tests for missing package.json
2022-05-06 12:58:12 -07:00
Jake Bailey
4765355e71
Fix more tests missing 'it' call in 'describe' (#48994) 2022-05-06 11:09:42 -07:00
Kenta Moriuchi
4a0b083c69
Add ES2022 Intl.Segmenter type (#48800)
* Add `Intl.Segmenter` type

* Update baseline

* Fix useless generics

* Fix indent size

* Fix `ResolvedSegmenterOptions`
2022-05-05 17:09:06 -07:00
Andrew Casey
58114cf387
Harden combineProjectOutputForReferences against empty results (#48978)
Getting an empty result doesn't seem expected, but a deeper fix doesn't make sense until #48619 is merged.

Fixes #48963
2022-05-05 13:52:34 -07:00
Andrew Branch
4680b54616
Clear ExportMapCache on cancellation requested (#48979) 2022-05-05 13:42:30 -07:00
Oleksandr T
f8a09bee6f
fix(48878): return errorType on invalid nodes in getTypeAtLocation (#48967) 2022-05-05 13:07:32 -07:00
Wesley Wigham
8e433cda3d
Allow export map entries to remap back to input files for a program (#47925)
* Allow export map entries to remap back to input files for a program

* Fix file casing issues on windows

* Implement abiguity error, doesnt quite work

* Refine selection logic in error case to use getCommonSourceDirectory, add more tests
2022-05-05 12:53:56 -07:00
Sheetal Nandi
1e157ef1b2
Fix node16 tests (#48974) 2022-05-05 11:45:05 -07:00
Daniel Rosenwasser
eb1a8b14cc
Remove some unused baselines. (#48964) 2022-05-05 10:33:52 -07:00
Nathan Shively-Sanders
650c056fa0
No error on toplevel return in JS (#48874)
* No error on toplevel return in JS

Turns out it's only an error in modules.
It's possible to keep this error on the list of "OK for JS" errors and
make the checker code stop issuing it for JS scripts only. However, I
don't think the error is valuable enough to do that.

Fixes #48224

* Restore 'return' statement.

* Update Baselines and/or Applied Lint Fixes

* Re-add missing baselines

* No error in toplevel script files

Only issue "no top-level return" error for modules, not scripts,
regardless of whether it's TS or JS.

* Keep Disallowing return in ambient locations

* Allow toplevel return only in non-ESM JS files

* Add test of toplevel return in JS script

* Revert "Add test of toplevel return in JS script"

This reverts commit 2a6dec475a35ec104915000984ffb79452cb7350.

* Revert "Allow toplevel return only in non-ESM JS files"

This reverts commit 6291ae3ba2df305d287f02223d634e21808fd15a.

* Revert "Keep Disallowing return in ambient locations"

This reverts commit 714ea8e524ff1129d94679df78f7790534222980.

* Revert "No error in toplevel script files"

This reverts commit 2056e13d5294a4d923b3f7c8e43dbc72f595afc6.

* restore orphaned baseline

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2022-05-05 09:35:15 -07:00
Nathan Shively-Sanders
46e8306050
Skip ambient modules in globalThis (#48938)
* Skip ambient modules in globalThis

Previously, globalThis mistakenly included ambient modules, even though
these are not values:

```ts
declare module "ambientModule" {
  export type typ = 1
  export var val: typ
}
type Oops = (typeof globalThis)[\"ambientModule\"]
```

This PR adds ambient modules to the kinds of things that are skipped
when constructing `globalThis`' properties, along with block-scoped
variables.

* Skip only modules with every declaration ambient

The modules are required to have at least one declaration so that our
treatment of `globalThis` stays the same, and
`globalThis.globalThis.globalThis` remains legal.
2022-05-05 09:33:32 -07:00
Jake Bailey
7d60dc1f5d
Revert "feat(47595): allow using private fields in type queries" (#48959) 2022-05-04 16:50:30 -07:00
Andrew Branch
e26bc8a117
Skip missing nodes in formatting (#48953) 2022-05-04 15:07:34 -07:00
Jake Bailey
f579f3307e
Revert "Don't treat a colon in a conditional expression branch as part of an arrow function" (#48940) 2022-05-04 15:01:05 -07:00
Oleksandr T
538d6ce828 fix(48948): disallow constructor name in class accessors and generators 2022-05-04 21:04:23 +03:00
Sheetal Nandi
c8ec855f9f
When source file is redirected, set the prototype correctly in node factory (#48862)
Fixes #48039
2022-05-04 08:59:11 -07:00
Andrew Branch
d879880a37
Don’t let other completions shadow type keywords in type locations (#48939)
* Allow type keywords with the same names as other completions

* Only add type keywords that are the same as other completions in type locations
2022-05-04 08:35:29 -07:00
Mateusz Burzyński
d337cbc19f
Run mocha using process.execPath instead of harcoding "node" (#48797) 2022-05-04 08:23:08 -07:00
BrandonXLF
ad2b7a6d31
Document encodeURIComponent/encodeURI's argument as unencoded (#48803) 2022-05-04 08:13:46 -07:00
Mateusz Burzyński
9469f95bd4
Add tests case for function check type being correctly paranthesized in quick info (#48836) 2022-05-03 17:05:37 -07:00
Daniel Rosenwasser
5f9c9a6ccf
Start Node ESM stable version at Node16 (#48879)
* Remove Node12, add Node16.

* Accepted baselines.

* Refactor checking for top-level await, give a better error message in CJS files.

* Accepted baselines.

* Stop erroring on JSON module imports in node ESM since they're no longer experimental.

* Accepted baselines.

* More refactoring, do the same checks for for-await loops.

* Accepted baselines.

* Adjust phrasing to permit for-await on CJS error.

* Accepted baselines.

* Accepted baselines.

* Fix lints.
2022-05-03 16:29:40 -07:00
Anders Hejlsberg
38c14606b4
Fix blocking of recursive dependencies in getNarrowedTypeOfSymbol (#48941)
* Better blocking of recursive dependencies in getNarrowedTypeOfSymbol

* Add regression test
2022-05-03 14:20:35 -07:00
Gabriela Araujo Britto
8f56f6b49d
Don't go past import in cross-project renaming (#48758)
* WIP

* fix cross-project renaming logic

* only use configure if prefix opt is defined

* refactor skipAlias into stopAtAlias

* fix stopAtAlias

* update another stopAtAlias location
2022-05-03 07:32:44 -07:00
Daniel Rosenwasser
3b8b2078a3
Temporarily revert unconstrained type parameter strictness in TS 4.7 (#48923)
* Revert a change around allowing unconstrained type parameters to '{}'.

* Accepted baselines.
2022-05-02 15:49:16 -07:00
那里好脏不可以
bb887ea1f2
fix(48557): Add missing JSDoc parameters (#48560)
* Fix jsdoc of some `DataView` method.

* Add author by 'Fix jsdoc of some `DataView` method'.

* Fix jsdoc of some `DataView` method.

change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.

* Fix jsdoc of some `DataView` method in `es2020.bigint.d.ts`.

change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.
2022-05-02 13:21:37 -07:00
Nathan Shively-Sanders
e73d755668
Fix formatter's processChildNodes (#48921)
processChildNodes needs to skip processing when the node array is
outside the target range, just like processChildNode already does for a
single node.

Fixes #48006
2022-05-02 12:50:24 -07:00
Mateusz Burzyński
63a941dc2a
Add a regression test for completion list in object literal involving inferred obj with optional members (#48910) 2022-05-02 12:27:49 -07:00
csigs
6834969f8f
LEGO: Merge pull request 48913
LEGO: Merge pull request 48913
2022-05-02 06:37:43 -07:00
TypeScript Bot
7cb88464de Update package-lock.json 2022-05-02 06:06:36 +00:00
csigs
eca1b4586c
LEGO: Merge pull request 48909
LEGO: Merge pull request 48909
2022-05-01 05:48:19 -07:00
TypeScript Bot
7ae09880f8 Update package-lock.json 2022-05-01 06:06:20 +00:00
Oleksandr T
99ffa394a8
fix(48759): throw an error on using import expression with type arguments (#48787) 2022-04-29 14:19:20 -07:00
Felipe Armoni
fd06132ce9
Fix #47753 - Organize imports removes type imports that are only referenced in @link (jsdoc) (#47824)
* Added unit test

* Added baseline test

* Dirty solution

* Code refactoring and improvements

* Added more test cases

* Refactor to use flatMap

* Added utility function to get all Nodes with JSDocs

* Minor improvements

* Use recursion to check all tree levels

* Removed unit test

* Removed previous changes

* Updated resolveEntityName call

* Updated dontResolveAlias clause

* Updated symbol flags

* Updated baseline

* Fix dont resolve alias problem

* Updated tests
2022-04-29 13:45:00 -07:00
Daniel Rosenwasser
18b08fc7c9
Use same error for iteration in <=ES5 (#48881)
* Use the same error for iterating over an Iterable in ES5 or lower.

* Accepted baselines.
2022-04-29 10:45:20 -07:00
TypeScript Bot
189c2b9e4a Update package-lock.json 2022-04-29 06:06:45 +00:00