33348 Commits

Author SHA1 Message Date
TypeScript Bot
76401adba3 Bump version to 4.7.4 and LKG v4.7.4 2022-06-16 17:59:56 +00:00
Daniel Rosenwasser
dfe885b302
Properly re-scan > token in type argument list determination logic (#49560) (#49570)
* Properly re-scan '>' token in type argument list determination logic

* Add regression test
2022-06-16 10:43:47 -07:00
TypeScript Bot
4d2983a736
Cherry-pick PR #49442 into release-4.7 (#49447)
Component commits:
d8f251b90a Avoid repeating codefix work when resolving auto-import specifiers for completions

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-06-09 11:05:04 -07:00
TypeScript Bot
e5050bb405 Bump version to 4.7.3 and LKG v4.7.3 2022-06-03 01:02:45 +00:00
TypeScript Bot
4c4c80322a
🤖 Pick PR #49360 (Expose import mode calculation func...) into release-4.7 (#49370)
* Cherry-pick PR #49360 into release-4.7

Component commits:
5eb6425569 Expose import mode calculation functions

1f907ae640 Make `SourceFileImportsList` internal again.

4e40185fe8 Accepted API baselines.

* Fix lints.

Co-authored-by: Daniel Rosenwasser <drosen@microsoft.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-06-02 17:47:14 -07:00
Daniel Rosenwasser
3ce08c6ba1
fix(49223): checker.getTypeAtLocation for ExpressionWithTypeArguments returns an error any type (#49284) (#49369)
* fix(49223): handle ExpressionWithTypeArguments nodes in isExpressionNode

* Update src/compiler/utilities.ts

* Just use `!isHeritageClause(node.parent)`.

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
2022-06-02 17:46:48 -07:00
Andrew Branch
3bf0d30686
Pick PR #49356 (Add nightly-only error on ImportType resolution mode assertion) into release-4.7 (#49365)
* Add nightly-only error on ImportType resolution mode assertion (#49356)

* Add nightly-only error on ImportType resolution mode assertion

* Temporarily change version to demonstrate errors

* Revert "Temporarily change version to demonstrate errors"

This reverts commit 40c2469647f129ea088a16d60f3f070f9f5beeb2.

* "Resolution mode" -> "resolution-mode"

* Update baselines
2022-06-02 16:25:52 -07:00
TypeScript Bot
5f7f0b1d57
Cherry-pick PR #49361 into release-4.7 (#49364)
Component commits:
fce91155fc Use node's algorithm for calculating the longest matching export/import pattern

Co-authored-by: Wesley Wigham <wewigham@microsoft.com>
2022-06-02 16:25:30 -07:00
TypeScript Bot
c07d883428
Cherry-pick PR #49313 into release-4.7 (#49359)
Component commits:
00b7574003 fix(49306): add isImportTypeAssertionContainer helper

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
2022-06-02 15:42:13 -07:00
TypeScript Bot
197aaef55f
Cherry-pick PR #49246 into release-4.7 (#49250)
Component commits:
b846905041 Add failing test

66d51e5114 Fix the implicit glob key so that recursive keys are not differing just by directory seperator Fixes #49078

f93951f4b8 Reset the reload level once program is loaded

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
2022-06-01 15:21:09 -07:00
TypeScript Bot
35519356ed
Cherry-pick PR #49268 into release-4.7 (#49276)
Component commits:
5d13ab280d moduleDetection: auto makes cjs files parse as modules, module: node sets moduleDetection: force

Co-authored-by: Wesley Wigham <t-weswig@microsoft.com>
2022-06-01 15:20:33 -07:00
TypeScript Bot
4e91c6cb08
🤖 Pick PR #49341 (Fix check in isMappedTypeGenericInd...) into release-4.7 (#49342)
* Cherry-pick PR #49341 into release-4.7

Component commits:
d347d87782 Fix check in isMappedTypeGenericIndexedAccess

e24c6f61b7 Add regression tests

* Update baselines.

Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-06-01 15:20:13 -07:00
TypeScript Bot
b24b05b5af
Cherry-pick PR #49327 into release-4.7 (#49329)
Component commits:
79957c179e Fix index fallback of CJS package from ESM-mode import when `main` is present but does not resolve

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-06-01 10:43:06 -07:00
TypeScript Bot
6e0328af6a
Cherry-pick PR #49252 into release-4.7 (#49272)
Component commits:
94cf1272e5 Fix `isVariableDeclarationInitializedToBareOrAccessedRequire` returning true on binding elements

fae1bbedc1 Undo auto format change

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-05-26 16:43:37 -07:00
TypeScript Bot
697df6ff41
Cherry-pick PR #49233 into release-4.7 (#49244)
Component commits:
1ab6396efe Fix extensions for noDtsResolution in node16/nodenext

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-05-25 15:27:54 -07:00
TypeScript Bot
cfd1a6e127 Bump version to 4.7.2 and LKG v4.7.2 2022-05-19 21:36:16 +00:00
TypeScript Bot
114e310de7
Cherry-pick PR #49157 into release-4.7 (#49167)
Component commits:
8d1095de7a Fix uncalled function check usage detection for && expressions

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-05-18 13:58:22 -07:00
TypeScript Bot
77b83f1106
Cherry-pick PR #49104 into release-4.7 (#49135)
Component commits:
4c6e802772 Remove bigint from Object.freeze in es5.d.ts
`BigInt` isn't resolved whenever `lib < es2020`, but it's not an error
when `target < es2020`. I have a few ideas for improving this situation
but for the RC I'm going to remove `bigint` from Object.freeze's
signature.

6d5bf6a5ee Update other baselines

e1958f7a23 No errors for missing apparent type of bigint,symbol for any target

86fc8dbd0b Update test text

Co-authored-by: Nathan Shively-Sanders <nathansa@microsoft.com>
2022-05-16 10:57:39 -07:00
Daniel Rosenwasser
7bd7163ac4 Update LKG. v4.7-rc 2022-05-11 00:12:27 +00:00
David Souther
a3e83be938 fix(44466): Fixes parsing contextual keyword casts as arrow functions
Use all modifiers test
2022-05-11 00:03:18 +00:00
Daniel Rosenwasser
e8216af8e4
Merge pull request #49031 from typescript-bot/pick/49010/release-4.7
🤖 Pick PR #49010 (LEGO: Pull request from lego/hb_537...) into release-4.7
2022-05-10 10:50:09 -07:00
Daniel Rosenwasser
854af3affb
Merge pull request #49030 from typescript-bot/pick/49016/release-4.7
🤖 Pick PR #49016 (LEGO: Pull request from lego/hb_537...) into release-4.7
2022-05-10 10:46:17 -07:00
TypeScript Bot
dbee2ab7fd
Cherry-pick PR #49035 into release-4.7 (#49036)
Component commits:
e8df495a1a Fix module specifier generation crash from typesVersions

Co-authored-by: Andrew Branch <andrew@wheream.io>
2022-05-09 12:49:02 -07:00
CSIGS
a7cf004fa5 Cherry-pick PR #49010 into release-4.7
Component commits:
f9d2ca03f0 Juno: check in to lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20220507124224201.
2022-05-09 17:50:37 +00:00
CSIGS
43e2066236 Cherry-pick PR #49016 into release-4.7
Component commits:
54c01e661e Juno: check in to lego/hb_5378966c-b857-470a-8675-daebef4a6da1_20220508150540507.
2022-05-09 17:50:28 +00:00
Daniel Rosenwasser
a5ec72564f
Merge pull request #49007 from microsoft/bump-4.7-rc
Sync and bump release 4.7 to RC
2022-05-06 17:21:01 -07:00
Daniel Rosenwasser
ca59c9bb57 Update LKG. 2022-05-06 23:40:37 +00:00
Daniel Rosenwasser
6c13ec8f10 Accepted baselines. 2022-05-06 23:39:28 +00:00
Daniel Rosenwasser
34e93a1f48 Bump version to 4.7.1-rc 2022-05-06 23:36:59 +00:00
Daniel Rosenwasser
c99b802227 Merge branch 'main' into release-4.7 2022-05-06 23:33:21 +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
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