Commit Graph

34591 Commits

Author SHA1 Message Date
Klaus Meinhardt 9171aa5a1b fix forEachChildRecursively (#42300) 2021-01-13 03:20:46 -08:00
Andrew Branch 33046e389a Do not suggest paths inside node_modules/.pnpm as module specifiers (#42095)
* Create symlink cache when a pnpm module is found

* Keep pnpm-internal symlinks out of the symlink cache

* Filter out  pnpm path from realpath module specifier too

* Use ignoredPaths instead of pnpm-specific path
2021-01-12 14:04:03 -08:00
Nathan Shively-Sanders 2f5863754f Improve naming of hasNonBindableDynamicName (#42297)
hasNonBindableDynamicName

1. Has 'non' in the name, and is only ever used negated.
2. Is true for a case that's not reflected correctly in the name -- it's
true for non-dynamic names as well.

I considered hasEarlyOrLateBindableName, but decided to use
hasBindableName for now.
2021-01-12 13:15:54 -08:00
Wesley Wigham c3dd845923 Better detect when typical nondistributive conditionals need to be defered by unwrapping their check and extends types (#42248) 2021-01-12 12:59:52 -08:00
Oleksandr T a276a6dce7 feat(31388): allow binding elements starting with an underscore (#41378) 2021-01-12 10:59:08 -08:00
TypeScript Bot a894f8ad2b Update package-lock.json 2021-01-12 06:43:39 +00:00
Andrew Branch b0f5e35777 'in' should not operate on primitive types (#41928 + @andrewbranch) (#42288)
* 'in' should not operate on primitive types

* accept baselines of failing tests

* review

* update error message

* check if constraint of right type is assignable to a non primitive or instantiable non primitive

* do not throw errors where narrowing is impossible

* accept baselines

* fix test case failures

* Add more accurate comment discussion and document failing edge case in test

* Update baselines

Co-authored-by: Jonas Hübotter <jonas.huebotter@gmail.com>
2021-01-11 16:46:08 -08:00
Anders Hejlsberg c456bbd466 Support re-aliasing of type alias instantiations (#42284)
* New aliases for type alias instantiations

* New aliases for conditional, mapped, and anonymous object type instantiations

* Accept new baselines

* Fix issues with re-aliasing

* Accept new baselines
2021-01-11 13:29:46 -10:00
Oleksandr T 1ecf22884f fix(42166): allow assertion signature for private identifiers (#42176) 2021-01-11 09:25:51 -08:00
TypeScript Bot 8ddea6b7a6 Update package-lock.json 2021-01-11 06:41:19 +00:00
Daniel Rosenwasser 79c72751df Update baselines. 2021-01-10 15:58:58 -08:00
Daniel Rosenwasser 16031bc429 Update LKG. 2021-01-10 15:58:40 -08:00
Oleksandr T 1cd8ee4b8d fix(42088): fix crash on unreachability condition in for statement (#42110) 2021-01-10 15:42:39 -08:00
TypeScript Bot eca8957430 Update package-lock.json 2021-01-09 06:38:00 +00:00
Anders Hejlsberg 6aeb8c12cc Preserve type aliases for union and intersection types (#42149)
* Create separate types for equivalent aliased unions

* Accept new baselines

* Preserve original types for union types

* Accept new baselines

* Preserve intersection origin for union types

* Accept new baselines

* Accept new baselines

* Preserve aliases during relationship checks

* Accept new baselines

* Preserve aliases for intersection and indexed access types

* Accept new baselines

* Compute intersection-of-unions cross product without recursion

* Accept new baselines

* Use denormalized type objects for origin / support 'keyof' origins

* Accept new baselines

* Fix fourslash test

* Recursively extract named union types

* Accept new baselines

* Map on union origin in mapType to better preserve aliases and origins

* Remove redundant call

* Accept new baselines

* Revert back to declared type when branches produce equivalent union

* Accept new baselines

* Don't include denormal origin types in regular type statistics

* Fix issue with unions not being marked primitive-only

* Allow new alias to be associated with type alias instantiation

* Accept new baselines

* Revert "Accept new baselines"

This reverts commit 4507270cc1.

* Revert "Allow new alias to be associated with type alias instantiation"

This reverts commit 2c2d06dfe1.
2021-01-08 15:19:58 -10:00
Oleksandr T 0c58edeb29 feat(26217): Add missing member fix should work for missing function (#41215)
* feat(26217): Add missing function declaration QF

* use codeFixAvailable instead of codeFix

* add diagnostics messages 'Method not implemented.' and 'Function not implemented.'

* use codeFixAvailable instead of codeFix

* fix signature types
2021-01-08 16:10:50 -08:00
Sheetal Nandi 66ba15a3fd If import is used in the file, prefer that import specifier over calculating new one (#42224)
* Test case where the wrong path is emitted

* If import is used in the file, prefer that import specifier over calculating new one
Fixes #39117

* Update Baselines and/or Applied Lint Fixes

* When non-relative path is used as user preference, ignore relative paths even if they are from the existing file

* Fix test

* Add comment

Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
2021-01-08 15:20:29 -08:00
Sheetal Nandi d36df0dda5 Try file if matched pattern specifies the extension instead of all the time (#42246)
* Test case for path mapping with extension

* Try file if matched pattern specifies the extension instead of all the time
Fixes #39743
2021-01-08 12:03:29 -08:00
Orta Therox 055f363fba Reverts #39277 removing bundledPackageName (#41499)
* Reverts #39277

* Bring back modeyule resolution for the test runner
2021-01-08 10:55:34 +00:00
Oleksandr T 042bf4eb15 feat(14248): add returns tag to JSDoc template (#42068) 2021-01-07 17:57:23 -08:00
Ron Buckton 0d284e6c26 Add support for abstract constructor types (#36392)
* Add support for abstract constructor types

* Add backwards-compatible overloads for creating/updating constructor types

* Reverting use of 'abstract' in lib/es5.d.ts due to eslint issues

* Update baseline due to reverting lib

* Add error for failing to mark an mixin class as abstract

* Fix declaration/quick info for abstract construct signatures
2021-01-07 17:11:14 -08:00
Nathan Shively-Sanders 3273dbc188 Finish #42230 by reverting webworker too (#42250) 2021-01-07 17:10:33 -08:00
Wesley Wigham 11606e4de4 Do for unions of many empty-object-spreadables what we did for unions of 2 (#42233)
* Do for unions of many empty-object-spreadables what we did for unions of 2

* Accept baseline
2021-01-07 12:05:40 -08:00
Andrew Branch dbba8b358f Make optional properties assignable to string index signatures (#41921) 2021-01-07 10:46:55 -08:00
Orta Therox 35c8df04ad Revert the DOM query changes (#42230)
* Revert the DOM query changes

* Adds baselines

* Hotfix for the removeal of the url nullabulity for testing
2021-01-06 22:21:16 +00:00
TypeScript Bot 6d50d480ce Update package-lock.json 2021-01-06 06:35:03 +00:00
Ron Buckton 44ec8ddaee Fix array spread with sideeffects (#41523)
* Fix array spread with sideeffects

* Minor cleanup, ensure multiple emit helpers for outfile tests
2021-01-05 17:24:21 -08:00
Christian 7a5aadca69 Adjust TS2691 message for .ts import sources (#42184)
* Adjust TS2691 message for .ts import sources

* Only ModuleKind is needed for TS2691 logic

* Added tests for TS2691
2021-01-05 11:10:04 -08:00
TypeScript Bot 64d0538920 Update package-lock.json 2021-01-05 06:34:31 +00:00
Anders Hejlsberg e1fda834f3 Cache complex union and intersection relations (#37910)
* Cache complex union/intersection relations

* Accept new baselines

* Accept new baselines
2021-01-04 15:15:01 -10:00
Anders Hejlsberg 9b1718677a Leading and middle rest elements in tuple types (#41544)
* Support starting and middle rest elements in tuples

* Accept new baselines

* Include all rest arguments in error span

* Accept new baselines

* Fix tests

* Add new tests

* Fix lint errors
2021-01-04 15:12:51 -10:00
Wesley Wigham 72dfc589a1 Retain CheckFlags.Late on symbols manufactured based on Late-bound symbols (#42205) 2021-01-04 15:49:52 -08:00
Oleksandr T b405fdd2ab fix(41420): forbid optional chain in extends/implements (#41481) 2021-01-04 15:38:54 -08:00
Ron Buckton 6fac3ddfd4 Fix module resolution for import call emit (#41390) 2021-01-04 15:08:57 -08:00
Song Gao b9ac2f50b8 remove duplicated type -- remove TriviaKind, keep TriviaSyntaxKind. (#42108) 2021-01-04 14:34:53 -08:00
Matt Kantor 1635b3293e Fix a small typo in the issue template. (#42208) 2021-01-04 14:15:51 -08:00
Oleksandr T 841b1a5bc7 fix(37791): fix incorrect private field access in a computed property name (#38135) 2021-01-04 14:01:54 -08:00
Orta Therox 222f29f2a5 Update lib dom for 4.2 (#42067) 2021-01-04 21:26:56 +00:00
ExE Boss 9a2ae118f1 fix(lib/es2015): Fix definition of ProxyHandler (#35594) 2021-01-04 12:34:51 -08:00
Oleksandr T 0876feb7cb fix(42160): omit unnecessary parentheses around assertions (#42169) 2021-01-04 11:24:37 -08:00
Oleksandr T f1dca6a61f fix(42019): include the jsdoc tags from the base declaration (#42098) 2021-01-04 15:33:26 +00:00
Brandon Pickering 822962e7b3 Improve documentation for basic array methods (#41961)
* Improve documentation for basic array methods

* Accept baseline changes for new lines from JSDoc changes

Co-authored-by: Orta <git@orta.io>
2021-01-04 10:06:01 +00:00
ExE Boss 562237dfda fix(lib/es2015): Fix types of Reflect methods (#41987) 2021-01-04 09:50:34 +00:00
Jonas Hübotter 15c54fb809 Add information on gulp diff to the contributing guidelines (#42031)
* Add information on gulp diff to the contributing guidelines

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2021-01-04 01:07:49 -08:00
TypeScript Bot a412512fa0 Update package-lock.json 2021-01-02 06:30:32 +00:00
TypeScript Bot 81fa6ae0f3 Update package-lock.json 2021-01-01 06:30:57 +00:00
TypeScript Bot f6287c5997 Update package-lock.json 2020-12-31 06:32:26 +00:00
chenjigeng ea93ee6db9 fix: host.isKnownTypesPackageName maybe undefined (#42050)
* fix: host.isKnownTypesPackageName maybe undefined

* feat: remove GH#18217 comment
2020-12-30 12:13:56 -08:00
Oleksandr T e108257fb6 fix(41965): fix error in definite assignment assertion context (#41989) 2020-12-30 11:45:18 -08:00
Oleksandr T dfe23421ba fix(41867): completions - omit the deprecated flag if some declarations are not deprecated (#41941) 2020-12-30 10:42:38 -08:00