34250 Commits

Author SHA1 Message Date
Alex Hsu
a66a1a6e25
LEGO: Merge pull request 50110
LEGO: Merge pull request 50110
2022-07-31 02:53:01 -07:00
TypeScript Bot
4f8c74033e Update package-lock.json 2022-07-31 06:06:24 +00:00
Alex Hsu
14fb0b06df
LEGO: Merge pull request 50104
LEGO: Merge pull request 50104
2022-07-30 03:47:04 -07:00
TypeScript Bot
e56942b7a9 Update package-lock.json 2022-07-30 06:06:37 +00:00
Oleksandr T
ae7d2325e9
fix(49869): throw an error on optional binding pattern parameter in JavaScript (#50094) 2022-07-29 16:05:34 -07:00
Ron Buckton
88a1e3a1dd
Transform decorators that reference private names into a 'static {}' block (#50074) 2022-07-29 15:29:48 -04:00
Mateusz Burzyński
5374fd924e
Add an additional test for favoring the asserted type in type predicate narrowing (#50065)
* Add an additional test for favoring the asserted type in type predicate narrowing

* Add requested test cases
2022-07-29 12:12:33 -07:00
Alex Hsu
4caa3f190f
LEGO: Merge pull request 50091
LEGO: Merge pull request 50091
2022-07-29 03:24:47 -07:00
TypeScript Bot
cc450cf820 Update package-lock.json 2022-07-29 06:06:35 +00:00
Zzzen
1490037f17
fix dts generation of jsdoc (#49904) 2022-07-28 17:44:23 -07:00
Sheetal Nandi
5d790526a1
Pass correct module resolution state when reading package.json info so that they are correctly tracked in the resolution (#50085) 2022-07-28 17:19:10 -07:00
Oleksandr T
949fffb1e0
feat(47983): Negative tuple index access should not be allowed (#49901)
* feat(47983): disallow negative integers for indexing tuple

* change error message

* add additional tests
2022-07-28 14:22:13 -07:00
Andrew Branch
b7355e30af
Fix trailing formatting edit when range ends mid-token (#50082) 2022-07-28 12:11:22 -07:00
TypeScript Bot
c9586f39e9 Update package-lock.json 2022-07-28 06:07:16 +00:00
Oleksandr T
94bb950008
feat(49358): use filename based on exported name (#49875) 2022-07-27 15:41:31 -07:00
Sheetal Nandi
5b0eea48e9
Report error only on local declaration with additional related information (#49746)
* Add test where the errors are reported in different file
Test for #49739

* Report error only on local declaration with additional related information
Fixes #49739

* Handle existing tests
2022-07-27 15:31:45 -07:00
Andrew Casey
c0461be025
Update pr_owners.txt
Add Navya
2022-07-27 15:12:08 -07:00
Jake Bailey
1361567ea4
Update to npm 8, pin in package.json via volta and corepack (#49941) 2022-07-27 14:02:24 -07:00
navya9singh
472584f9cd Changes to resolve pr comments 2022-07-27 13:18:35 -07:00
Jake Bailey
8d0c72d5e0
Normalize effective constraint intersection before checking if source is a part of it (#49956) 2022-07-27 10:06:01 -07:00
Jake Bailey
adfb20fbeb
Don't uninstall typescript before npm ci in GHA (#50062) 2022-07-27 09:42:22 -07:00
Jake Bailey
df58836577
Use proper type for result of resultModuleNamesReusingOldState (#50012) 2022-07-27 09:30:52 -07:00
Anders Hejlsberg
a4507c9225
Favor asserted type in type predicate narrowing (#50044)
* Favor asserted type in type predicate narrowing

* Accept new baselines
2022-07-26 17:39:35 -07:00
Josh Goldberg
ebd42abf95
Account for type parameters in missing function codefix (#49727)
* Account for type parameters in missing function codefix

* Apply suggestions from code review

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

* WIP

* Synthesize new type parameters instead of deep unions and intersections

* Pass along type parameter constraints

* E.T. phone home

* Clean up comments just a bit

* Only widen the instance type sometimes

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-07-26 15:22:19 -07:00
Danilo Lekovic
78e2bfd712
Fix(49525): Adds documentation for the Proxy type. (#49674)
* Adds documentation for the Proxy type.

* Removed trailing whitespace.

* Addresses PR feedback.

* Removes trivial comments and adds descriptive names.
2022-07-26 13:25:10 -07:00
Jake Bailey
3afe2d654e
Resolve parsingContextErrors TODO (#50011)
* Add a test with broken code

* Resolve TODO
2022-07-26 08:59:06 -07:00
Oleksandr T
bcd22b47d2
fix(50048): remove token name from id (#50051) 2022-07-26 01:13:04 -07:00
navya9singh
34c3b9cf49 Fixed changes to previous commit:
Co-authored-by: graphemecluster <graphemecluster@gmail.com>
2022-07-25 14:26:09 -07:00
Jake Bailey
b5b02eefc8
Walk tokens with the correct walker (#50042) 2022-07-25 14:26:00 -07:00
Ron Buckton
12dbdf03b1
Parse parameter decorators outside of Await context when appropriate (#50040) 2022-07-25 17:17:27 -04:00
navya9singh
04df1e18d9 Follow up changes to es5.d.ts 2022-07-25 12:25:45 -07:00
navya9singh
3cade4ca24 String.prototype.replace docs fix.
Co-authored-by: graphemecluster <graphemecluster@gmail.com>
2022-07-25 11:53:20 -07:00
TypeScript Bot
a179e910dd Update package-lock.json 2022-07-25 06:06:48 +00:00
Anders Hejlsberg
4026c6fd80
Properly handle null and undefined in getCommonSupertype (#50021)
* Properly handle null and undefined in getCommonSupertype

* Add tests

* Add more tests
2022-07-24 08:09:14 -07:00
Alex Hsu
165a1c4a40
LEGO: Merge pull request 50024
LEGO: Merge pull request 50024
2022-07-24 03:31:04 -07:00
Jake Bailey
966e732ed4
Remove uses of visitNodes and visitNode in visitEachChild (#49992) 2022-07-22 19:35:39 -07:00
Andrew Branch
6aefc1dcea
More fixes to uncalled function checks in && expressions (#49868) 2022-07-22 16:06:16 -07:00
Jake Bailey
4e23f515e0
Protect watcher from double close (#49990) 2022-07-22 13:32:16 -07:00
Oleksandr T
455ea9b41f
fix(49964): handle auto-import dependencies/omit duplicate constraints (#50004) 2022-07-22 11:01:43 -07:00
Armando Aguirre
7b764164ed
Fixed closing JSDoc when adding multiple blocks (#49888)
* Fixed closing JSDoc when adding multiple blocks

* Fixed linting errors

* Refactored to use `some`

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

* Removed empty lines

Co-authored-by: Armando Aguirre <araguir@microsoft.com>
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-07-21 13:16:40 -07:00
Oleksandr T
5d2e62a810
fix(49854): fix start index to emit statements after super (#49858) 2022-07-20 16:02:30 -07:00
Oleksandr T
5702941c2f
fix(49719): Incorrect error 2301 when using ES standard class properties (#49725)
* fix(49719): omit TS2301 error with enabled usedefineforclassfields

* show error for target lower than esnext with useddefineforclassfields enabled

* change target from esnext to es2022
2022-07-20 14:36:35 -07:00
Nathan Shively-Sanders
2f51a9e859
Update DOM lib for 4.8 RC (#49976) 2022-07-20 11:37:57 -07:00
TypeScript Bot
2644fb0b5c Update package-lock.json 2022-07-20 06:07:22 +00:00
Oleksandr T
f6ac10958f
fix(49704): Code folding not working in file with simple syntax error (#49743)
* fix(49704): parse type arguments in super call expression

* omit duplicate errors
2022-07-19 16:26:56 -07:00
Nathan Shively-Sanders
7f3ca9f8f7
Copy type parameters to function with @type tag (#49960)
* Copy type parameters to function with @type tag

Previously, type references to generic types would fail to copy type
parameters from type references in an `@type` tag. Now the type
parameter is copied.

Note that I left 3 places in the checker unchanged, even though they
should technically also get type parameters from type refereneces:

1. getOuterTypeParameters -- not fixing this means that nested function
still won't get instantiated correctly. I'll see how hard this is to
fix.
2. getLocalTypeParameterOfClassOrInterfaceOrTypeAlias -- only applies to
constructor functions which have a type annotation, which doesn't type
check in the first place.
3. isThislessType -- This function is conservative, so should be
possible to make it more conservative without writing a lot of code.

Fixes #49039

* Update API baselines
2022-07-19 15:40:53 -07:00
Jake Bailey
aba867d15a
Clean up inference of type parameters, contravariant types (#49915) 2022-07-19 15:30:48 -07:00
Andrew Casey
8402d657ab
Document order-dependence of isLocal flag (#49959) 2022-07-19 14:38:35 -07:00
navya9singh
9b1cbe059b Added type checks to avoid false positive results 2022-07-19 14:38:24 -07:00
Oleksandr T
5a53e9bb5e
fix(49838): "Extract function" refactoring action is disabled for a wrong reason (#49840)
* fix(49838): allow extracting functions with a break statement inside loop context

* remove useless flag

* add more tests
2022-07-19 13:06:45 -07:00