32057 Commits

Author SHA1 Message Date
Wesley Wigham
a5607a4eab
Dont allow namespace reexport symbols when looking up valid local names (#43969) 2021-05-06 12:03:48 -07:00
Sheetal Nandi
233f28ca27
When directory watcher is invoked with any file from node_modules package, invalidate for file paths in that package (#43974)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-05-06 09:48:26 -07:00
Oleksandr T
e0d7703cf3
fix(43939): forbid converting getters to async/await (#43944) 2021-05-06 01:48:54 -07:00
Ikko Ashimine
97f5c62956
Fix typo in system.ts (#43895)
assigment -> assignment
2021-05-06 01:40:00 -07:00
TypeScript Bot
b8da22e6c3 Update package-lock.json 2021-05-06 06:05:58 +00:00
Wesley Wigham
456806b070
Allow filterType to consider union constraints of non-union types when determining never-ness (#43763)
* Allow filterType to consider union constraints of non-union types when determining never-ness

* Move impl to callback

* Baseline change in narrowing behavior into test, fix post-LKG build
2021-05-05 13:35:09 -07:00
Wesley Wigham
b83148fe64
Unwrap substitutions on conditional check types before comparing them (#43888) 2021-05-05 13:33:45 -07:00
Wesley Wigham
84da19efc8
Add single-element fastpath to getSupertypeOrUnion (#43934) 2021-05-05 13:32:23 -07:00
Oleksandr T
6f8c3b0c99
fix(43957): insert Override keyword after static modifier (#43959) 2021-05-05 08:52:50 -07:00
TypeScript Bot
2ef2718b2f Update package-lock.json 2021-05-05 06:05:59 +00:00
Sheetal Nandi
f7ef1540d3
Use options from referenced project for including resolved imports in the file when using sources of project reference (#43914)
* Test where allowJs present in referenced project affects picking up right set of import files

* use options from referened project for including resolved imports in the file when using sources of project reference
Fixes #43909
2021-05-03 11:35:21 -07:00
TypeScript Bot
7a2a687c81 Update package-lock.json 2021-05-02 06:06:27 +00:00
Nathan Shively-Sanders
7a8c5a0001
Displayparts resolves non-values in link tags (#43903)
Previously, the name resolution for link tags in displaypart generation
mistakenly required a valueDeclaration. Now it uses the first
declaration if there is no valueDeclaration, so that types and
namespaces will also resolve.

This is another instance of using valueDeclaration as "the default
declaration", which doesn't apply to types.

Fixes #43868
2021-04-30 14:17:54 -07:00
Sheetal Nandi
54096bdb96
Use project relative preference for declaration emit (#42232)
* Test where relative import isnt ideal in the declaration emit

* use project relative preference for declaration emit
Fixes #39117

* Fix incorrect path matching when calculating module specifier

* Use correct baseUrl for the module specifier
2021-04-30 13:22:05 -07:00
Sheetal Nandi
c96b472e0b
Handle localness in special cases by checking exported variable assignment (#43851)
* Handle localness in special cases by checking exported variable assignment
Fixes #42976

* Fix existing tests where arrow now behaves similar to function expression

* Update src/services/goToDefinition.ts
2021-04-30 13:17:59 -07:00
Nathan Shively-Sanders
c9eb62fafb
getExternalModuleMember:always resolve alias of moduleSymbol (#43718)
Previously, getExternalModuleMember passed through its received value of
`dontResolveAlias` to every function that accepted it. That includes (1)
resolution of the module symbol and (2) resolution of the module
specifier. However, in TS, the module symbol is never an alias anyway, so
dontResolveAlias doesn't make a difference. In JS, the module symbol
*can* be an alias, and it should always be resolved. That's what this PR
does.

Fixes #43713
2021-04-30 10:47:45 -07:00
TypeScript Bot
d16790e3cc Update package-lock.json 2021-04-30 06:06:15 +00:00
Nathan Shively-Sanders
004b3ae018
Simplify arity errors, rewording spread errors (#43855)
* Scribbles + tests

The second test actually requires node types

* Basically working

The two simple fixes, in arity error reporting, are in, and the
simplification of arity error reporting is half-done. I haven't started
on any improvements to call assignability.

* trim out too-real test case

* Finish cleanup

And reword error a little.

* Simplify and reword spread errors

* handle spreads first

* update baselines

* Address PR comments
2021-04-29 14:38:50 -07:00
Xu Zhuo
4ecb563aa4
Complete constructor keyword after property declaration (#43654)
* Complete `constructor` keyword after property declaration.

* Fix logical errors.

* Fix for more universal situations.

* Only provide completions if property declaration is terminated.

* Simplify many logical conditions.

* Make the fix more reliable.

* Narrowing the fix.
2021-04-29 11:16:51 -07:00
Oleksandr T
3e25424652
fix(43408): emit nullable/optional types on getters (#43476) 2021-04-29 09:20:40 -07:00
Acy Watson
b31b0eb05c
Use single quotes consistently in diagnostic messages. (#43634) 2021-04-29 07:15:31 -07:00
TypeScript Bot
37035dab6e Update package-lock.json 2021-04-29 06:06:20 +00:00
Andrew Branch
a14b22718a
Enforce keyword order of abstract and override (#43829)
* Enforce keyword order of abstract and override

* Update baselines

* Update existing test
2021-04-28 16:41:28 -07:00
Andrew Branch
791c747e06
Allow override as parameter property (#43831)
* Allow `override` as parameter property

* Update other baseline

* Add test for override on normal parameter

* Copy typo fix

* Update baselines

* Update API baseline
2021-04-28 16:41:09 -07:00
Nathan Shively-Sanders
db09cb5951
typeRelatedToSomeType passes through intersectionState (#43707)
* typeRelatedToSomeType passes through intersectionState

Previously it didn't, even though it should have.

* fix parameter name lint
2021-04-28 16:12:20 -07:00
Andrew Branch
58c54127a9
Fix node.getStart() for nodes spanning multiline JSDoc comments (#43854) 2021-04-28 11:37:27 -07:00
TypeScript Bot
046c65af0c Update package-lock.json 2021-04-28 06:08:16 +00:00
Wesley Wigham
7748694d60
Relate non-augmenting subtypes without resorting to structural comparison (#43624)
* Relate non-augmenting array subtypes without resorting to structural comparison

* Fix lint

* Generalize performance enhancement

* Cache results, feed through via getNormalizedType to remove error intermediates

* Use newly freed up object flags to limit member setting, fix crash with those object flags

* Move flags because there is no TypeFlags.Reference 🤦
2021-04-27 22:52:12 -07:00
Wesley Wigham
5e4fcfbfb6
Add instantiation rules for reverse mapped types (#42449)
* Add instantiation rules for reverse mapped types

* Add smaller example of same issue
2021-04-27 15:01:46 -07:00
athongsavath
cfb9a25cc5
Update handbook link in readme (#43813)
Co-authored-by: Andrew Thongsavath <andrew@athongsavath.com>
2021-04-27 19:17:29 +01:00
Wesley Wigham
bbad560912
Refrain from attempting to perform parameter fixing on a generic signature multiple times (#43835)
* Refrain from attempting to perform parameter fixing on a generic signature multiple times

* Remove assertion
2021-04-27 10:49:27 -07:00
TypeScript Bot
353dc1814f Update package-lock.json 2021-04-27 06:08:01 +00:00
Andrew Branch
3de706a852
Don’t create invalid type-only imports during add missing import (#43828) 2021-04-26 11:52:34 -07:00
Nathan Shively-Sanders
d5af89c552
Contextual typing checks property assignments for type annotation (#43598)
Property assignments can have a type annotation in JS. This PR adds a
check for it in contextual typing.

Fixes #43379
2021-04-26 09:19:24 -07:00
Andrew Branch
b9c1e98544
Fix completions of exports elsewhere in same file (#43755)
* Fix completions of exports elsewhere in same file

* Undo messing up JSDoc-annotated module.exports assignments

* Add other failing contextual type test

* Rearrange contextual type logic for special assignments

* Rename helper function
2021-04-26 09:13:09 -07:00
TypeScript Bot
514d8d8841 Update package-lock.json 2021-04-25 06:07:54 +00:00
Erik Brinkman
4d4ea66a9c
update contextual discrimination to include omitted members (#43633)
This diff extends the types checked by
discriminateContextualTypeByObjectMembers and
discriminateContextualTypeByJSXAttributes to also include any optional
components in the type union.

fixes #41759 although it doesn't address the better error reporting for
their last repro, which I'm not sure how to address.
2021-04-24 14:26:29 -07:00
TypeScript Bot
0ad158e164 Update package-lock.json 2021-04-24 06:07:33 +00:00
Oleksandr T
482f781386
fix(43559): allow renaming in files with no-default-lib enabled (#43579) 2021-04-23 16:56:33 -07:00
Nathan Shively-Sanders
d171eee044
Omit spaces after https in jsdoc comments (#43800)
* Omit spaces after https in jsdoc comments

for tags with names.

Fxes #42581

* fix semicolon lint
2021-04-23 16:23:34 -07:00
Wesley Wigham
dee4903f45
Compute dervied generic-ness for substitutions and create lower priority inferences for substitutes (#43765) 2021-04-23 15:51:05 -07:00
Andrew Branch
bd7d0f26b2
Don’t allow an object literal with a spread as a fallback for destructuring a property not present in all constituents (#43783)
* Add test

* Don’t allow an object literal with a spread as a fallback for destructuring a property not present in all constituents
2021-04-23 14:44:57 -07:00
Zak Miller
c552a4bf82
fix(42829) ignore preceeding jsx whitespace (#43452) 2021-04-22 15:12:05 -07:00
TypeScript Bot
1a41e19957 Update package-lock.json 2021-04-22 06:08:15 +00:00
Sheetal Nandi
f6d425e1e3
Module Resolution and Type Reference directive cache updates and its API changes (#43700)
* Make the module resolution cache apis for updating compiler options or clearing it

* Cache package.json lookup results from module resolution

* Use per directory cache for type reference directive resolution as well

* Update Baselines and/or Applied Lint Fixes

* Change trace according to feedback

* Update Baselines and/or Applied Lint Fixes

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-04-21 21:30:18 -07:00
Sheetal Nandi
fb0b1d7295
Handle getter setter quickInfo (#43769)
Fixes #43413
2021-04-21 17:47:11 -07:00
Andrew Branch
ba68dc89b2
Remove pin, it’s fixed (#43766) 2021-04-21 14:18:04 -07:00
Wesley Wigham
f4b8adca6a
Comment copy edit 2021-04-21 12:51:36 -07:00
Wesley Wigham
8ea4ec9496
Add infer T constraint inference rule matching up mapped type templates across check/extends types (#43649) 2021-04-21 12:49:02 -07:00
Andrew Branch
a433c3c0ce
Pin octokit types (#43762)
* Pin @octokit/types to fix build error

* Allow update package lock to be run on a workflow dispatch
2021-04-21 11:50:29 -07:00