Skip to content

Commit 89cfe35

Browse files
committed
Merge branch 'main' into add-literal-preserving-freeze-overload
2 parents a5cb1a6 + 112dd24 commit 89cfe35

File tree

18,626 files changed

+2145891
-755558
lines changed

Some content is hidden

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

18,626 files changed

+2145891
-755558
lines changed

.devcontainer/Dockerfile

+7
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

+22
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+
}

.dockerignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ scripts/buildProtocol.js
2222
scripts/ior.js
2323
scripts/authors.js
2424
scripts/configurePrerelease.js
25-
scripts/configureTSCBuild.js
2625
scripts/open-user-pr.js
2726
scripts/open-cherry-pick-pr.js
2827
scripts/processDiagnosticMessages.d.ts
2928
scripts/processDiagnosticMessages.js
3029
scripts/produceLKG.js
3130
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
3231
scripts/generateLocalizedDiagnosticMessages.js
32+
scripts/configureLanguageServiceBuild.js
3333
scripts/*.js.map
3434
scripts/typings/
3535
coverage/
@@ -43,7 +43,6 @@ yarn-error.log
4343
.parallelperf.*
4444
.failed-tests
4545
TEST-results.xml
46-
package-lock.json
4746
tests
4847
.vscode
4948
.git

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/built/local/**
22
/tests/**
33
/lib/**
4-
/src/lib/*.generated.d.ts
4+
/src/lib/*.generated.d.ts

.eslintrc.json

+34-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,37 @@
1717
"@typescript-eslint/adjacent-overload-signatures": "error",
1818
"@typescript-eslint/array-type": "error",
1919

20-
"camelcase": "off",
21-
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
20+
"brace-style": "off",
21+
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
22+
23+
"@typescript-eslint/naming-convention": [
24+
"error",
25+
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
26+
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false }, "filter": { "regex": "^I(Arguments|TextWriter|O([A-Z][a-z]+[A-Za-z]*)?)$", "match": false } },
27+
{ "selector": "variable", "format": ["camelCase", "PascalCase", "UPPER_CASE"], "leadingUnderscore": "allow", "filter": { "regex": "^(_{1,2}filename|_{1,2}dirname|_+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
28+
{ "selector": "function", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
29+
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", "match": false } },
30+
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
31+
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
32+
{ "selector": "enumMember", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
33+
{ "selector": "property", "format": null }
34+
],
2235

23-
"@typescript-eslint/class-name-casing": "error",
2436
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
25-
"@typescript-eslint/interface-name-prefix": "error",
37+
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
38+
39+
"max-statements-per-line": ["error", { "max": 1 }],
40+
41+
"no-duplicate-imports": "off",
42+
"@typescript-eslint/no-duplicate-imports": "error",
43+
2644
"@typescript-eslint/no-inferrable-types": "error",
2745
"@typescript-eslint/no-misused-new": "error",
2846
"@typescript-eslint/no-this-alias": "error",
47+
48+
"no-unused-expressions": "off",
49+
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
50+
2951
"@typescript-eslint/prefer-for-of": "error",
3052
"@typescript-eslint/prefer-function-type": "error",
3153
"@typescript-eslint/prefer-namespace-keyword": "error",
@@ -36,6 +58,13 @@
3658
"semi": "off",
3759
"@typescript-eslint/semi": "error",
3860

61+
"space-before-function-paren": "off",
62+
"@typescript-eslint/space-before-function-paren": ["error", {
63+
"asyncArrow": "always",
64+
"anonymous": "always",
65+
"named": "never"
66+
}],
67+
3968
"@typescript-eslint/triple-slash-reference": "error",
4069
"@typescript-eslint/type-annotation-spacing": "error",
4170
"@typescript-eslint/unified-signatures": "error",
@@ -54,6 +83,7 @@
5483
"simple-indent": "error",
5584
"debug-assert": "error",
5685
"no-keywords": "error",
86+
"one-namespace-per-file": "error",
5787

5888
// eslint-plugin-import
5989
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
@@ -65,7 +95,6 @@
6595
"jsdoc/check-alignment": "error",
6696

6797
// eslint
68-
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
6998
"constructor-super": "error",
7099
"curly": ["error", "multi-line"],
71100
"dot-notation": "error",
@@ -74,7 +103,6 @@
74103
"new-parens": "error",
75104
"no-caller": "error",
76105
"no-duplicate-case": "error",
77-
"no-duplicate-imports": "error",
78106
"no-empty": "error",
79107
"no-eval": "error",
80108
"no-extra-bind": "error",
@@ -96,7 +124,6 @@
96124
"no-trailing-spaces": "error",
97125
"no-undef-init": "error",
98126
"no-unsafe-finally": "error",
99-
"no-unused-expressions": ["error", { "allowTernary": true }],
100127
"no-unused-labels": "error",
101128
"no-var": "error",
102129
"object-shorthand": "error",

.github/ISSUE_TEMPLATE/Bug_report.md

+73-37
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,73 @@
1-
---
2-
name: Bug report
3-
about: Create a report to help us improve
4-
5-
---
6-
7-
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨
8-
9-
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!
10-
11-
Please help us by doing the following steps before logging an issue:
12-
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
13-
* Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ
14-
15-
Please fill in the *entire* template below.
16-
-->
17-
18-
<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
19-
**TypeScript Version:** 3.4.0-dev.201xxxxx
20-
21-
<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
22-
**Search Terms:**
23-
24-
**Code**
25-
26-
```ts
27-
// A *self-contained* demonstration of the problem follows...
28-
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
29-
```
30-
31-
**Expected behavior:**
32-
33-
**Actual behavior:**
34-
35-
**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
36-
37-
**Related Issues:** <!-- Did you find other bugs that looked similar? -->
1+
---
2+
name: Bug
3+
about: Create a report to help us improve TypeScript
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
# Bug Report
9+
10+
<!--
11+
Please fill in each section completely. Thank you!
12+
-->
13+
14+
### 🔎 Search Terms
15+
16+
<!--
17+
What search terms did you use when trying to find an existing bug report?
18+
List them here so people in the future can find this one more easily.
19+
-->
20+
21+
### 🕗 Version & Regression Information
22+
23+
<!-- When did you start seeing this bug occur?
24+
25+
"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
26+
https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs
27+
28+
If possible, please try testing the nightly version of TS to see if it's already been fixed.
29+
For npm: `typescript@next`
30+
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
31+
32+
Note: The TypeScript Playground can be used to try older versions of TypeScript.
33+
34+
Please keep and fill in the line that best applies:
35+
-->
36+
- This is a crash
37+
- This changed between versions ______ and _______
38+
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
39+
- I was unable to test this on prior versions because _______
40+
41+
### ⏯ Playground Link
42+
43+
<!--
44+
A link to a TypeScript Playground "Share" link which shows this behavior
45+
46+
The TypeScript Workbench can be used for more complex setups, try
47+
https://www.typescriptlang.org/dev/bug-workbench/
48+
49+
As a last resort, you can link to a repo, but these will be slower for us to investigate.
50+
-->
51+
[Playground link with relevant code](https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA)
52+
53+
### 💻 Code
54+
55+
<!-- Please post the relevant code sample here as well-->
56+
```ts
57+
// We can quickly address your report if:
58+
// - The code sample is short. Nearly all TypeScript bugs can be demonstrated in 20-30 lines of code!
59+
// - It doesn't use external libraries. These are often issues with the type definitions rather than TypeScript bugs.
60+
// - The incorrectness of the behavior is readily apparent from reading the sample.
61+
// Reports are slower to investigate if:
62+
// - We have to pare too much extraneous code.
63+
// - We have to clone a large repo and validate that the problem isn't elsewhere.
64+
// - The sample is confusing or doesn't clearly demonstrate what's wrong.
65+
```
66+
67+
### 🙁 Actual behavior
68+
69+
<!-- What happened, and why it was wrong -->
70+
71+
### 🙂 Expected behavior
72+
73+
<!-- What you expected to happen instead, and why -->
+59-45
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,59 @@
1-
---
2-
name: Feature request
3-
about: Suggest an idea for this project
4-
5-
---
6-
7-
<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨
8-
9-
Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.
10-
11-
Please help us by doing the following steps before logging an issue:
12-
* Search: https://github.com/Microsoft/TypeScript/search?type=Issues
13-
* Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ
14-
15-
-->
16-
17-
## Search Terms
18-
19-
<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->
20-
21-
## Suggestion
22-
23-
<!-- A summary of what you'd like to see added or changed -->
24-
25-
## Use Cases
26-
27-
<!--
28-
What do you want to use this for?
29-
What shortcomings exist with current approaches?
30-
-->
31-
32-
## Examples
33-
34-
<!-- Show how this would be used and what the behavior would be -->
35-
36-
## Checklist
37-
38-
My suggestion meets these guidelines:
39-
40-
* [ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
41-
* [ ] This wouldn't change the runtime behavior of existing JavaScript code
42-
* [ ] This could be implemented without emitting different JS based on the types of the expressions
43-
* [ ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
44-
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
45-
1+
---
2+
name: Feature Request
3+
about: Suggest an idea
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
# Suggestion
9+
10+
<!--
11+
Please fill in each section completely. Thank you!
12+
-->
13+
14+
## 🔍 Search Terms
15+
16+
<!--
17+
💡 Did you know? TypeScript has over 2,000 open suggestions!
18+
🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
19+
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
20+
21+
Replace the text below:
22+
-->
23+
24+
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.
25+
26+
## ✅ Viability Checklist
27+
28+
<!--
29+
Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
30+
We always recommend reviewing the TypeScript design goals before investing time writing
31+
a proposal for ideas outside the scope of the project.
32+
-->
33+
My suggestion meets these guidelines:
34+
35+
* [ ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
36+
* [ ] This wouldn't change the runtime behavior of existing JavaScript code
37+
* [ ] This could be implemented without emitting different JS based on the types of the expressions
38+
* [ ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
39+
* [ ] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
40+
41+
42+
## ⭐ Suggestion
43+
44+
<!-- A summary of what you'd like to see added or changed -->
45+
46+
## 📃 Motivating Example
47+
48+
<!--
49+
If you were announcing this feature in a blog post, what's a short explanation that shows
50+
a developer why this feature improves the language?
51+
-->
52+
53+
## 💻 Use Cases
54+
55+
<!--
56+
What do you want to use this for?
57+
What shortcomings exist with current approaches?
58+
What workarounds are you using in the meantime?
59+
-->

.github/ISSUE_TEMPLATE/Question.md

-15
This file was deleted.

0 commit comments

Comments
 (0)