Commit Graph
100 Commits
Author SHA1 Message Date
Wesley Wigham 54fa69cb47 Fix API under exactOptionalPropertyTypes (#48505) 2022-03-31 21:45:34 -07:00
Wesley WighamandNathan Shively-Sanders ddad61e1b0 Add an overload to Object.freeze that preserves literal types (#33767)
* Add an overload to Object.freeze that preserves literal types

* Accept changes baselines

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-03-03 14:23:41 -08:00
Wesley Wigham f82d0cb329 Add explicit assertion on somewhat commonly incorrectly passed argument (#48078)
* Add explicit assertion on somewhat commonly incorrectly passed argument

* PR feedback
2022-03-02 09:13:42 -08:00
Wesley Wigham ea0db9e031 Add import assertions to type only imports and import types to force the resolution mode of the specifier (#47807)
* Add import assertions for type-only imports and import types to change resolver modes

* By popular request, only allow mode assertions on top-level type only imports

* Add specifier options parameter to specifier generation
2022-03-02 08:54:10 -08:00
Wesley Wigham ff1f7b15b7 Esm imports of cjs files should unconditionally have a default patched on (#48062) 2022-03-02 08:53:31 -08:00
Wesley Wigham 71918750f9 Use full isReadonlySymbol check rather than declaration flags (#48064)
* Use full `isReadonlySymbol` check rather than declaration flags

* Limit subtype readonly consistency check to strict subtype relation

* Update comment
2022-02-28 14:35:33 -08:00
Wesley Wigham 03c11c8f70 Add missing getReducedType call in getConditionalTypeInstantiation (#48061) 2022-02-28 13:41:10 -08:00
Wesley WighamandNathan Shively-Sanders 67172e41c2 Triple-slash reference type directives can override the import mode used for their resolution (#47732)
* Triple-slash reference type directives can override the import mode used for their resolution

They now use the file's default mode by default, rather than always using commonjs. The new arguments to the
reference directive look like:

```ts
///<reference types="pkg" resolution-mode="require" />
```

or

```ts
///<reference types="pkg" resolution-mode="import" />
```

* Omit redundant import modes in emitter

* Add test for #47806

* Add server test for triple-slash reference mode overrides

* Move FileReference mode into helper

* Update tests/cases/conformance/node/nodeModulesTripleSlashReferenceModeOverride3.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-02-15 13:53:11 -08:00
Wesley Wigham e32281cc02 Allow extensionless mains for cjs mode packages even from an esm import (#47893) 2022-02-14 14:13:21 -08:00
Wesley Wigham 7e57c81802 Explicitly annotate return type of getCommentRange (#47860) 2022-02-14 09:21:43 -08:00
Wesley Wigham 1bdb0d90bf ESM mode nonrelative imports should assume index.js entrypoints even if no package main is present (#47854) 2022-02-11 15:44:11 -08:00
Wesley Wigham e204acfa26 Ensure subtype relation ordering for readonly properties (#47069)
* Ensure subtype relation ordering for readonly properties

* Probably fix post-LKG assignability error
2022-02-11 14:59:01 -08:00
Wesley Wigham 033f9e0081 Consider a symbol visible for declaration emit when it is the target of an ambient module's export= (#47835)
* Consider a symbol visible for declaration emit when it is the target of an ambient module's export=

* Just use resolveExternalModuleSymbol
2022-02-11 14:58:31 -08:00
Wesley Wigham 4c80036b7d Enable path completions for node12/nodenext (#47836)
* Enable path completions for node12/nodenext

* Explicitly pull path completions from export maps when available

* Explicitly handle pattern exports by stopping up to the star
2022-02-11 10:54:04 -08:00
Wesley Wigham f4b8adca6a Comment copy edit 2021-04-21 12:51:36 -07:00
Wesley Wigham ebaa926f39 Fix post-LKG build 2020-11-11 16:50:08 -08:00
Wesley Wigham 44595042b2 Comment position feedback 2020-11-11 13:02:09 -08:00
Wesley Wigham 2c7c62d7fa Merge branch 'master' into fix-incremental-jsx-crash 2020-11-11 13:00:47 -08:00
Wesley Wigham dc7d997e4a Fix crash on attempting to suggest a ts import for a synthetic js resolution 2020-11-09 14:05:17 -08:00
Wesley WighamandSheetal Nandi 1e1ae3034b Update src/compiler/program.ts
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2020-10-30 16:21:36 -07:00
Wesley Wigham fe94a2180c Use same metho as importHelpers to add synthetic import 2020-10-30 16:16:23 -07:00
Wesley Wigham 8493ee8824 Add mroe incremental-affecting affixes to compiler options, add incremental test for changing jsxImportSource 2020-10-30 16:01:27 -07:00
Wesley Wigham fe3b3436e6 Add affectsModuleResolution: true ot jsx and jsxImportSource options 2020-10-30 15:38:20 -07:00
Wesley Wigham 6714998e01 Auto-include types for the jsx import source in the new jsx transforms 2020-10-29 14:17:24 -07:00
Wesley Wigham 60b8bbcabe Update style 2020-10-29 13:03:25 -07:00
Wesley Wigham d722392d81 Fix crashes when the global JSX namespace is an alias 2020-10-28 14:31:40 -07:00
Wesley Wigham 4ec02a56b8 Bind comma expression LHS call expressions 2020-10-28 13:48:29 -07:00
Wesley Wigham e96ce39b60 Fixup other fourslash test 2020-10-27 16:25:30 -07:00
Wesley Wigham d1bc6b1ba6 Bind module.export = {Thing} with alias symbols 2020-10-27 15:43:00 -07:00
Wesley Wigham 2abc8bd3fa Limit binding element visibility painting to those biding elements which are declarations of aliases 2020-10-26 16:47:43 -07:00
Wesley Wigham ef810f5d02 Fix visibility lookup for cjs require aliases 2020-10-26 14:37:35 -07:00
Wesley Wigham 3bbc963303 Style feedback 2020-10-22 16:42:35 -07:00
Wesley Wigham 6dde1621cb Track control flow for comma expressions in call expressions 2020-10-21 12:31:29 -07:00
Wesley Wigham f4255dd237 Handle the new js binding element alias symbols in JS declaration emit 2020-10-21 11:24:19 -07:00
Wesley Wigham 0ad22de146 Merge branch 'master' into fix/create-element-new-jsx-transform 2020-10-19 15:21:52 -07:00
Wesley Wigham c29d3f8f6f Accept updated baselines 2020-10-19 14:57:51 -07:00
Wesley Wigham aa9445bc15 Merge branch 'master' into empty-jsx-child 2020-10-19 14:54:20 -07:00
Wesley Wigham 33b8a4fbd2 Accept updated baselines 2020-10-19 14:32:26 -07:00
Wesley Wigham de93173f53 Revert "Add extensions to jsx automatically added import, per babel change (#40871)"
This reverts commit 798b18be6e.
2020-10-19 14:27:28 -07:00
Wesley Wigham b8dfa28ca8 Do not consider empty jsx expressions semantically important children 2020-10-19 13:34:16 -07:00
Wesley Wigham 1cdb621257 Use minimal endings when generating declarations for js 2020-10-12 16:01:32 -07:00
Wesley Wigham e46a0380f9 Fix baselines now that dupe test is gone 2020-10-12 14:16:01 -07:00
Wesley Wigham abaafe170e Delete duplicate test 2020-10-12 14:12:07 -07:00
Wesley Wigham 34fb470087 Merge branch 'master' into spread-compact-literals 2020-10-12 14:10:51 -07:00
Wesley Wigham 39c2a09b1f Fix crash due to unchecked cast in addImplementationSuccessElaboration 2020-10-09 10:53:59 -07:00
Wesley Wigham f324fde873 Fix lint 2020-10-08 17:34:06 -07:00
Wesley Wigham ca26ca1dd0 Small baseline change - find() will get the first declaration with a body 2020-10-08 17:20:09 -07:00
Wesley Wigham de204430ec PR feedback 2020-10-08 17:17:06 -07:00
Wesley Wigham 6b29f36674 Rename variable 2020-10-08 16:14:47 -07:00
Wesley Wigham a49099fd15 Add elaboration when call fails all overloads but succeeds against the implementation signature 2020-10-08 14:55:14 -07:00
Wesley Wigham d6af322287 Add comment 2020-10-07 12:27:43 -07:00
Wesley Wigham c6734afba5 Adjust typeof import name lookup to better match type query lookup 2020-10-07 12:08:20 -07:00
Wesley Wigham 87c83306dd Use suggested command, add now-fixed log 2020-10-06 12:56:51 -07:00
Wesley Wigham f8382d720f Add pyright user test 2020-10-06 12:37:05 -07:00
Wesley Wigham 3df8bc6a03 Rephrase to use binarySearchKey 2020-10-06 12:29:58 -07:00
Wesley Wigham da57f9876e Improve the performance of requesting completions within a massive array literal 2020-10-05 14:42:10 -07:00
Wesley Wigham b86dc34386 Limit when we allow nested unique symbols to be serialized to when their declaration is within the same file as the context 2020-10-01 15:20:01 -07:00
Wesley Wigham e9465c5de5 Properly compare path prefixes when generating module paths 2020-10-01 14:56:32 -07:00
Wesley Wigham 4156662e14 Accept updated baseline 2020-09-25 11:54:33 -07:00
Wesley Wigham 74779ba4fb Add test 2020-09-25 11:50:40 -07:00
Wesley Wigham 17d996e6b2 Revert 7181c2af 2020-09-25 11:45:16 -07:00
Wesley Wigham 081f98232b Handle the mapping between Array and ReadonlyArray in isTypeDerivedFrom 2020-09-16 13:31:13 -07:00
Wesley Wigham 6cd2dc9546 Accept baseline from test added since merged PR was made 2020-09-05 02:30:42 -07:00
Wesley Wigham 3a75838cb7 include stdout in runSequence thrown error 2020-09-02 14:35:00 -07:00
Wesley Wigham 62a1b357c2 Unignore the package-lock.json in the root Dockerignore, fixing docker suite tests 2020-09-02 14:31:51 -07:00
Wesley Wigham 44d9ceaf14 Small branch sync script change 2020-08-13 13:17:05 -07:00
Wesley Wigham 5519027600 Minor fixes to consmetic build issues in user test PR script 2020-07-17 06:43:50 -07:00
Wesley Wigham 58330d05a1 Patch to use this.timeout() > 0 rather than this.enableTimeout() to work with mocha 8+ 2020-06-10 14:26:22 -07:00
Wesley Wigham 59d0ceef5e Fix recently added test so it is cross-plat 2020-05-21 11:45:23 -07:00
Wesley Wigham bc8a98ff00 Add node 13 to CI 2020-04-09 16:16:06 -07:00
Wesley Wigham 0e48e68ed1 Fix post-LKG build 2020-04-01 10:53:46 -07:00
Wesley Wigham d34af449ca Recognise master branch-equivalent as master 2020-03-11 15:19:39 -07:00
Wesley Wigham 6f079a4ebc Update versionMajorMinor to match package.json 2020-02-11 15:34:17 -08:00
Wesley Wigham fe2b9e9e17 Assert ranges exist when looped over in fourslash (#32012) 2019-06-21 10:38:31 -07:00
Wesley Wigham 38da682de7 Unify contextual signature type parameter assignment (#31574)
* Unify conditional signature type assignment

* Moonomorphism
2019-06-05 14:35:00 -07:00
Wesley Wigham d7f03fb0fa Parse generic function types in import type argument lists (#31079)
* Parenthesize in import type node factory

* And now parse unparenthesized generic functions so we can handle parsing the older output
2019-04-23 14:48:31 -07:00
Wesley Wigham bb1ac81bb1 Experimental management scripts (#31067)
* Add configure-experimental

* Add script for synchronizing branches with master and creating an experimental branch with the result of merging those
2019-04-23 13:52:23 -07:00
Wesley Wigham b47194bfa1 Fix contextual types for a single jsx child (#31040) 2019-04-23 13:51:39 -07:00
Wesley Wigham b02b823f03 Track parameter references errors in resolve name rather than secondary pass (#30349) 2019-04-23 13:46:19 -07:00
Wesley Wigham 53c92d608f Add configure-experimental (#31064) 2019-04-22 13:20:34 -07:00
Wesley Wigham 7a3e68fc5c Only return the substitute in substitution instantiation when assignability fails (rather than subtype) (#31027)
* Only return the substitute in substitution instantiation when assignability fails (rather than subtype)

* Add test from issue
2019-04-19 16:02:11 -07:00
Wesley Wigham 40a2eb2b4b Unify couldContainTypeVariables and the similar check done during instantiation (#30969)
* Stop symbol based filtering in couldContainTypeVariables

* Unify couldContainTypeVariables and the similar check done during instantiation
2019-04-19 16:01:53 -07:00
Wesley Wigham 1a4c15fb11 handle generic types in getArrayifiedType (#30606) 2019-04-19 14:32:33 -07:00
Wesley Wigham d987907d2b Remove no longer extant gulp command from README (#31019) 2019-04-18 11:38:01 -07:00
Wesley Wigham 0574c1fae1 Hide the table of perf results from the bot inside an expando element (#31007) 2019-04-18 09:09:22 -07:00
Wesley Wigham 169e485d90 Perform excess property checking on intersection and union members (#30853)
* Perform excess property checking on intersection and union members

* Allow partial union props to contain the undefined type

* Add test case from #30771

* Un-terse getPossiblePropertiesOfUnionType side-effecting code

* Fix bug exposed in RWC

* Cache results of getPossiblePropertiesOfUnionType

* Fix whitespace
2019-04-16 21:58:48 -07:00
Wesley Wigham d405662eb6 Explicitly encode keyof behaviors for never and unknown into getIndexType (#30753)
* Explicitly encode keyof behaviors for never and unknown into getIndexType

* Merge similar cases
2019-04-15 17:52:13 -07:00
Wesley Wigham c1f2aba364 Cache substitution types (#30775) 2019-04-05 14:37:47 -07:00
Wesley Wigham 16450a027a Change the default type parameter constraints and defaults to unknown from {} (#30637)
* Change the default type parameter constraint and default to unknown from {}

* Relax unknown checking outside of strictNullChecks a bit

* Increase strictness on index signatures with type `unknown` so inference doesnt change surprisingly

* Remove redundant switch
2019-04-04 12:25:15 -07:00
Wesley Wigham ca98a50574 Use const contexts and tuple mapped types to simplify some explicitly elucidated types (#30654)
* Use const contexts and tuple mapped types to simplify some explicitly elucidated types

* Fix lint

* Further cleanup - refactor mapped type into its own alias for readability

* Slightly more cleanup - PragmaPsuedoMap neednt be partial, thus removing tons of nonull assertions

* Remove GH#18217 comments
2019-04-02 13:04:51 -07:00
Wesley Wigham b7881a26a0 Unify substitution type any handling into costruction and instantiation (#30592)
* Unify substitution type `any` handling into costruction and instantiation

* Strengthen supertype reduction check to reduce breakage

* Rename conditional type fields per convention

* Explicitly handle anyish signatures in compareSignaturesRelated so strict variance doesnt kill subtyping

* Allow tuple expansions to an `any` rest to be considered an `any` signature as well
2019-03-27 12:55:17 -07:00
Wesley Wigham e20b87f66d Add script for posting perf results back to GH (#30526)
* Add script for posting perf results back to GH

* Slightly more logging, use html url, not api url, lol

* Log even more, nonzero exit code on error
2019-03-22 17:39:20 -07:00
Wesley Wigham 1639a5a2c2 Handle huge unions better in createUnionOrIntersectionProperty (#30411)
* Handle huge unions better in createUnionOrIntersectionProperty

* Mimic first-in-wins behavior of pushIfUnique to retain order

* !props -> props.length === 0 (why dont we warn on that ffs)

* Avoid collection into an array if there are no properties
2019-03-22 09:56:39 -07:00
Wesley Wigham b86dea03f2 Fix crash caused by cyclic defaults (#30532) 2019-03-21 18:27:14 -07:00
Wesley Wigham 9e28a811c5 Remove circularity fallback deferral in getConditionalType (#30470) 2019-03-18 16:35:41 -07:00
Wesley Wigham 3127962cd1 Fix authors script (#30440) 2019-03-18 12:26:27 -07:00
Wesley Wigham 563593b8be Enable better error spans for async functions (#30413) 2019-03-14 17:10:42 -07:00
Wesley Wigham 5d08b68122 Fix react-redux break on DT (#30375)
* Forbid reentrancy in conditional type creation (force deferal on occurance)

* Add repro from react-redux, accept updated baselines
2019-03-13 15:21:46 -07:00
Wesley Wigham ddf8fad6a8 Delete webtsc gulp tasks (#30350) 2019-03-12 17:06:54 -07:00
Wesley Wigham 3ba5aa9f60 Add regression test for #29692 (#30325) 2019-03-11 15:41:05 -07:00