Skip to content

Commit 9408d18

Browse files
committed
Merge remote-tracking branch 'mine/extract-symbol-this' into extract-symbol-this
2 parents 68623bc + 0e954e5 commit 9408d18

File tree

10,291 files changed

+1050928
-245835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,291 files changed

+1050928
-245835
lines changed

.devcontainer/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.154.0/containers/javascript-node/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Node.js version: 14, 12, 10
4+
ARG VARIANT="14-buster"
5+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
6+
7+
RUN sudo -u node npm install -g gulp-cli

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Node.js",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "14"
7+
}
8+
},
9+
"settings": {
10+
"terminal.integrated.defaultProfile.linux": "bash",
11+
"terminal.integrated.profiles.linux": {
12+
"bash": {
13+
"path": "/bin/bash",
14+
"icon": "terminal-bash",
15+
},
16+
},
17+
},
18+
"extensions": [
19+
"dbaeumer.vscode-eslint"
20+
],
21+
"remoteUser": "node"
22+
}

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
],
3535

3636
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
37+
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
38+
39+
"max-statements-per-line": ["error", { "max": 1 }],
3740

3841
"no-duplicate-imports": "off",
3942
"@typescript-eslint/no-duplicate-imports": "error",

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,69 @@ assignees: ''
77

88
---
99

10-
<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨
10+
# Bug Report
1111

12-
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!
12+
<!--
13+
Please fill in each section completely. Thank you!
14+
-->
1315

14-
Please help us by doing the following steps before logging an issue:
15-
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
16-
* Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ
16+
### 🔎 Search Terms
1717

18-
Please fill in the *entire* template below.
18+
<!--
19+
What search terms did you use when trying to find an existing bug report?
20+
List them here so people in the future can find this one more easily.
1921
-->
2022

21-
<!--
22-
Please try to reproduce the issue with the latest published version. It may have already been fixed.
23+
### 🕗 Version & Regression Information
24+
25+
<!-- When did you start seeing this bug occur?
26+
27+
"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
28+
https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs
29+
30+
If possible, please try testing the nightly version of TS to see if it's already been fixed.
2331
For npm: `typescript@next`
2432
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
33+
34+
Note: The TypeScript Playground can be used to try older versions of TypeScript.
35+
36+
Please keep and fill in the line that best applies:
2537
-->
26-
**TypeScript Version:** 3.7.x-dev.201xxxxx
38+
- This is a crash
39+
- This changed between versions ______ and _______
40+
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
41+
- I was unable to test this on prior versions because _______
2742

28-
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
29-
**Search Terms:**
43+
### ⏯ Playground Link
44+
45+
<!--
46+
A link to a TypeScript Playground "Share" link which shows this behavior
47+
48+
The TypeScript Workbench can be used for more complex setups, try
49+
https://www.typescriptlang.org/dev/bug-workbench/
50+
51+
As a last resort, you can link to a repo, but these will be slower for us to investigate.
52+
-->
53+
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA)
3054

31-
**Code**
55+
### 💻 Code
3256

57+
<!-- Please post the relevant code sample here as well-->
3358
```ts
34-
// A *self-contained* demonstration of the problem follows...
35-
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
59+
// We can quickly address your report if:
60+
// - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
61+
// - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
62+
// - The incorrectness of the behavior is readily apparent from reading the sample.
63+
// Reports are slower to investigate if:
64+
// - We have to pare too much extraneous code.
65+
// - We have to clone a large repo and validate that the problem isn't elsewhere.
66+
// - The sample is confusing or doesn't clearly demonstrate what's wrong.
3667
```
3768

38-
**Expected behavior:**
69+
### 🙁 Actual behavior
3970

40-
**Actual behavior:**
71+
<!-- What happened, and why it was wrong -->
4172

42-
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
73+
### 🙂 Expected behavior
4374

44-
**Related Issues:** <!-- Did you find other bugs that looked similar? -->
75+
<!-- What you expected to happen instead, and why -->

.github/ISSUE_TEMPLATE/Feature_request.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,55 @@ assignees: ''
77

88
---
99

10-
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨
11-
12-
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.
13-
14-
Please help us by doing the following steps before logging an issue:
15-
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
16-
* Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ
10+
# Suggestion
1711

12+
<!--
13+
Please fill in each section completely. Thank you!
1814
-->
1915

20-
## Search Terms
16+
## 🔍 Search Terms
2117

22-
<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->
18+
<!--
19+
💡 Did you know? TypeScript has over 2,000 open suggestions!
20+
🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
21+
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
2322
24-
## Suggestion
23+
Replace the text below:
24+
-->
2525

26-
<!-- A summary of what you'd like to see added or changed -->
26+
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
2727

28-
## Use Cases
28+
## ✅ Viability Checklist
2929

3030
<!--
31-
What do you want to use this for?
32-
What shortcomings exist with current approaches?
31+
Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
32+
We always recommend reviewing the TypeScript design goals before investing time writing
33+
a proposal for ideas outside the scope of the project.
3334
-->
34-
35-
## Examples
36-
37-
<!-- Show how this would be used and what the behavior would be -->
38-
39-
## Checklist
40-
4135
My suggestion meets these guidelines:
4236

4337
* [ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
4438
* [ ] This wouldn't change the runtime behavior of existing JavaScript code
4539
* [ ] This could be implemented without emitting different JS based on the types of the expressions
46-
* [ ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
40+
* [ ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
4741
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
42+
43+
44+
## ⭐ Suggestion
45+
46+
<!-- A summary of what you'd like to see added or changed -->
47+
48+
## 📃 Motivating Example
49+
50+
<!--
51+
If you were announcing this feature in a blog post, what's a short explanation that shows
52+
a developer why this feature improves the language?
53+
-->
54+
55+
## 💻 Use Cases
56+
57+
<!--
58+
What do you want to use this for?
59+
What shortcomings exist with current approaches?
60+
What workarounds are you using in the meantime?
61+
-->
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Library change
3+
about: Fix or improve issues with built-in type definitions like `lib.dom.d.ts`, `lib.es6.d.ts`,
4+
etc.
5+
title: ''
6+
labels: ''
7+
assignees: ''
8+
9+
---
10+
11+
# lib Update Request
12+
13+
<!--
14+
Please fill in each section completely. Thank you!
15+
16+
Are you here for one of these commonly-requested lib changes?
17+
* Object.keys - see https://stackoverflow.com/questions/55012174/
18+
* Array methods - see https://github.com/microsoft/TypeScript/issues/36554
19+
* parseInt, parseFloat, isFinite, isNaN, etc. - see https://github.com/microsoft/TypeScript/issues/4002
20+
21+
The DOM lib is maintained elsewhere and you can skip a step by filing issues/PRs for the DOM at that repo.
22+
See https://github.com/microsoft/TypeScript-DOM-lib-generator
23+
-->
24+
25+
## Configuration Check
26+
27+
<!--
28+
If you're missing common new methods like Array.includes, you may have a misconfigured project.
29+
Try setting `lib: "es2020"` and checking whether the type you want is present.
30+
You can diagnose further by running `tsc` with `--listFilesOnly` or `--showConfig`.
31+
32+
Conversely, if you are seeing built-in methods you expect to *not* see, check your 'lib' setting
33+
or review your dependencies for lib/reference directives that might be polluting
34+
your global scope. This is common when using the 'node' type library. See https://github.com/microsoft/TypeScript/issues/40184
35+
36+
Replace the text below:
37+
-->
38+
My compilation *target* is `ES2015` and my *lib* is `the default`.
39+
40+
## Missing / Incorrect Definition
41+
42+
<!--
43+
What property, method, function, etc is missing or incorrect?
44+
-->
45+
46+
## Sample Code
47+
48+
<!--
49+
What's some code using this that should work, but doesn't?
50+
-->
51+
52+
## Documentation Link
53+
54+
<!--
55+
Link to relevant documentation (e.g. MDN, W3C, ECMAScript Spec) to consult for this property.
56+
Note that lib.dom.d.ts intentionally does not include browser-specific extensions
57+
or early experimental features.
58+
-->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Types Not Correct in/with Callback
3+
about: TypeScript assuming the wrong type either after a callback runs, or within
4+
a callback
5+
title: ''
6+
labels: Duplicate
7+
assignees: ''
8+
9+
---
10+
11+
TypeScript has two narrowing-related behaviors that are both intentional. Please do not log additional bugs on this; see #9998 for more discussion.
12+
13+
The first is that *narrowings are not respected in callbacks*. In other words:
14+
```ts
15+
function fn(obj: { name: string | number }) {
16+
if (typeof obj.name === "string") {
17+
// Errors
18+
window.setTimeout(() => console.log(obj.name.toLowerCase());
19+
}
20+
}
21+
```
22+
This is intentional since the value of `obj.name` "could" change types between when the narrowing occurred and when the callback was invoke. See also #11498
23+
24+
The second is that *function calls do not reset narrowings*. In other words:
25+
```ts
26+
function fn(obj: { name: string | number }) {
27+
if (typeof obj.name === "string") {
28+
console.log("Here");
29+
// Does not error
30+
console.log(obj.name.toLowerCase());
31+
}
32+
}
33+
```
34+
This is intentional behavior, *even though `console.log` could have mutated obj*. This rule is consistently applied, even with the function is in-principle inspectable to actually have side effects
35+
```ts
36+
function fn(obj: { name: string | number }) {
37+
if (typeof obj.name === "string") {
38+
mut();
39+
// Does not error
40+
console.log(obj.name.toLowerCase());
41+
}
42+
43+
function mut() {
44+
obj.name = 42;
45+
}
46+
}
47+
```

.github/issue_template.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/pr_owners.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ ahejlsberg
1010
amcasey
1111
jessetrinity
1212
minestarks
13-
uniqueiniquity
13+
armanio123
14+
gabritto
15+
jakebailey
16+
DanielRosenwasser

.github/pull_request_template.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ Thank you for submitting a pull request!
33
44
Please verify that:
55
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
6-
* [ ] Code is up-to-date with the `master` branch
6+
* [ ] Code is up-to-date with the `main` branch
77
* [ ] You've successfully run `gulp runtests` locally
88
* [ ] There are new or updated unit tests validating the change
99
1010
Refer to CONTRIBUTING.MD for more details.
11-
https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md
11+
https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md
12+
13+
** Please don't send typo fixes! **
14+
Please don't send a PR solely for the purpose of fixing a typo, unless that
15+
typo truly hurts understanding of the text. Each PR represents work for the
16+
maintainers, and that work should provide commensurate value.
17+
18+
If you're interested in sending a PR, the issue tracker has many issues marked `help wanted`.
1219
-->
1320

1421
Fixes #

0 commit comments

Comments
 (0)