Skip to content

Commit 3849e5e

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # src/compiler/checker.ts # tests/baselines/reference/arrayDestructuringInSwitch1.types # tests/baselines/reference/arraySlice.types # tests/baselines/reference/bestChoiceType.types # tests/baselines/reference/bivariantInferences.types # tests/baselines/reference/callsOnComplexSignatures.types # tests/baselines/reference/complexRecursiveCollections.types # tests/baselines/reference/contextualOverloadListFromArrayUnion.types # tests/baselines/reference/controlFlowArrayErrors.types # tests/baselines/reference/jsxChildrenWrongType.types # tests/baselines/reference/ramdaToolsNoInfinite2.types # tests/baselines/reference/sliceResultCast.types # tests/baselines/reference/unionOfArraysFilterCall.types # tests/baselines/reference/unionOfClassCalls.types
2 parents 8291654 + 3a74ec4 commit 3849e5e

File tree

8,543 files changed

+505482
-168170
lines changed

Some content is hidden

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

8,543 files changed

+505482
-168170
lines changed

.dprint.jsonc

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
"arrowFunction.useParentheses": "preferNone",
2020
"conditionalExpression.linePerExpression": false, // Keep our "match/case"-ish conditionals.
2121
"functionExpression.spaceAfterFunctionKeyword": true,
22-
"importDeclaration.forceMultiLine": true,
22+
"importDeclaration.forceMultiLine": "whenMultiple",
2323
"constructorType.spaceAfterNewKeyword": true,
2424
"constructSignature.spaceAfterNewKeyword": true,
2525

26-
// Let eslint-plugin-simple-import-sort handle this.
27-
"module.sortImportDeclarations": "maintain",
28-
"module.sortExportDeclarations": "maintain",
29-
"exportDeclaration.sortNamedExports": "maintain",
30-
"importDeclaration.sortNamedImports": "maintain"
26+
"module.sortImportDeclarations": "caseInsensitive",
27+
"module.sortExportDeclarations": "caseInsensitive",
28+
"exportDeclaration.sortNamedExports": "caseInsensitive",
29+
"importDeclaration.sortNamedImports": "caseInsensitive"
3130
},
3231
"prettier": {
3332
"newLineKind": "lf",
@@ -53,12 +52,13 @@
5352
"tests/**",
5453
"internal/**",
5554
"**/*.generated.*",
56-
"scripts/*.d.*"
55+
"scripts/*.d.*",
56+
"**/_namespaces/**"
5757
],
5858
// Note: if adding new languages, make sure settings.template.json is updated too.
5959
"plugins": [
60-
"https://plugins.dprint.dev/typescript-0.88.9.wasm",
61-
"https://plugins.dprint.dev/json-0.19.1.wasm",
62-
"https://plugins.dprint.dev/prettier-0.35.0.json@0df49c4d878bb1051af2fa1d1f69ba6400f4b78633f49baa1f38954a6fd32b40"
60+
"https://plugins.dprint.dev/typescript-0.90.0.wasm",
61+
"https://plugins.dprint.dev/json-0.19.2.wasm",
62+
"https://plugins.dprint.dev/prettier-0.39.0.json@896b70f29ef8213c1b0ba81a93cee9c2d4f39ac2194040313cd433906db7bc7c"
6363
]
6464
}

.eslintrc.json

+16-20
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
],
1818
"plugins": [
1919
"@typescript-eslint",
20-
"no-null",
21-
"eslint-plugin-local",
22-
"simple-import-sort"
20+
"eslint-plugin-local"
2321
],
2422
"ignorePatterns": [
2523
"**/node_modules/**",
@@ -61,6 +59,18 @@
6159
"prefer-object-spread": "error",
6260
"unicode-bom": ["error", "never"],
6361

62+
"no-restricted-syntax": [
63+
"error",
64+
{
65+
"selector": "Literal[raw=null]",
66+
"message": "Avoid using null; use undefined instead."
67+
},
68+
{
69+
"selector": "TSNullKeyword",
70+
"message": "Avoid using null; use undefined instead."
71+
}
72+
],
73+
6474
// Enabled in eslint:recommended, but not applicable here
6575
"no-extra-boolean-cast": "off",
6676
"no-case-declarations": "off",
@@ -110,13 +120,14 @@
110120
}
111121
],
112122
"@typescript-eslint/no-unused-vars": [
113-
"error",
123+
"warn",
114124
{
115125
// Ignore: (solely underscores | starting with exactly one underscore)
116126
"argsIgnorePattern": "^(_+$|_[^_])",
117127
"varsIgnorePattern": "^(_+$|_[^_])"
118128
}
119129
],
130+
"@typescript-eslint/no-inferrable-types": "off",
120131

121132
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
122133
"@typescript-eslint/prefer-optional-chain": "off",
@@ -133,14 +144,7 @@
133144
"local/no-in-operator": "error",
134145
"local/debug-assert": "error",
135146
"local/no-keywords": "error",
136-
"local/jsdoc-format": "error",
137-
138-
// eslint-plugin-no-null
139-
"no-null/no-null": "error",
140-
141-
// eslint-plugin-simple-import-sort
142-
"simple-import-sort/imports": "error",
143-
"simple-import-sort/exports": "error"
147+
"local/jsdoc-format": "error"
144148
},
145149
"overrides": [
146150
// By default, the ESLint CLI only looks at .js files. But, it will also look at
@@ -167,14 +171,6 @@
167171
{ "name": "exports" }
168172
]
169173
}
170-
},
171-
{
172-
// These files contain imports in a specific order that are generally unsafe to modify.
173-
"files": ["**/_namespaces/**"],
174-
"rules": {
175-
"simple-import-sort/imports": "off",
176-
"simple-import-sort/exports": "off"
177-
}
178174
}
179175
]
180176
}

.github/ISSUE_TEMPLATE/bug_report.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ description: 'Create a report to help us improve TypeScript'
33
body:
44
- type: markdown
55
attributes:
6-
value: Please fill in each section completely. Thank you!
6+
value: |
7+
🔍 Please [search thoroughly in GitHub](https://github.com/Microsoft/TypeScript/search?type=Issues) or by the query `site:github.com/microsoft/TypeScript <your keywords>` in your favorite search engine before reporting a new bug as most bugs are very likely to find precedents.
8+
9+
Please fill in each section completely. Thank you!
710
- type: textarea
811
id: search_terms
912
attributes:

.github/ISSUE_TEMPLATE/feature_request.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ description: 'Suggest an idea'
33
body:
44
- type: markdown
55
attributes:
6-
value: 'Please fill in each section completely. Thank you!'
6+
value: |
7+
💡 Did you know? TypeScript has over 2,000 open suggestions!
8+
9+
🔎 Please [search thoroughly in GitHub](https://github.com/Microsoft/TypeScript/search?type=Issues) or by the query `site:github.com/microsoft/TypeScript <your keywords>` in your favorite search engine before logging new feature requests as most common ideas already have a proposal in progress.
10+
11+
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
12+
13+
Please fill in each section completely. Thank you!
714
- type: textarea
815
id: search_terms
916
attributes:
1017
label: '🔍 Search Terms'
1118
description: |
12-
💡 Did you know? TypeScript has over 2,000 open suggestions!
19+
What search terms did you use when trying to find an existing suggestion?
1320
14-
🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
15-
16-
The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests
21+
List them here so people in the future can find this one more easily.
1722
placeholder: |
1823
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.
1924

.github/workflows/accept-baselines-fix-lints.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
20+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2121
with:
2222
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
2323
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
24+
with:
25+
node-version: 'lts/*'
2426

2527
- name: Configure Git, Run Tests, Update Baselines, Apply Fixes
2628
run: |

.github/workflows/ci.yml

+27-13
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
- windows-latest
3030
- macos-14
3131
node-version:
32+
- '22'
3233
- '20'
3334
- '18'
3435
- '16'
@@ -48,7 +49,7 @@ jobs:
4849
name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}${{ (!matrix.bundle && ' with --no-bundle') || '' }}
4950

5051
steps:
51-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
52+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
5253
- name: Use node version ${{ matrix.node-version }}
5354
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
5455
with:
@@ -63,13 +64,16 @@ jobs:
6364

6465
- name: Print baseline diff on failure
6566
if: ${{ failure() && steps.test.conclusion == 'failure' }}
66-
run: git diff --diff-filter=AM --no-index -- ./tests/baselines/reference ./tests/baselines/local
67+
run: |
68+
npx hereby baseline-accept
69+
git add tests/baselines/reference
70+
git diff --staged --exit-code
6771
6872
lint:
6973
runs-on: ubuntu-latest
7074

7175
steps:
72-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
76+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
7377
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
7478
with:
7579
node-version: '*'
@@ -83,14 +87,14 @@ jobs:
8387
runs-on: ubuntu-latest
8488

8589
steps:
86-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
90+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
8791
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
8892
with:
8993
node-version: '*'
9094
check-latest: true
9195
- run: npm ci
9296

93-
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
97+
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
9498
with:
9599
path: ~/.cache/dprint
96100
key: ${{ runner.os }}-dprint-${{ hashFiles('package-lock.json', '.dprint.jsonc') }}
@@ -104,7 +108,7 @@ jobs:
104108
runs-on: ubuntu-latest
105109

106110
steps:
107-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
111+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
108112
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
109113
with:
110114
node-version: '*'
@@ -121,7 +125,7 @@ jobs:
121125
runs-on: ubuntu-latest
122126

123127
steps:
124-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
128+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
125129
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
126130
with:
127131
node-version: '*'
@@ -135,7 +139,7 @@ jobs:
135139
runs-on: ubuntu-latest
136140

137141
steps:
138-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
142+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
139143

140144
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
141145
with:
@@ -151,6 +155,7 @@ jobs:
151155

152156
- run: npx hereby lkg
153157
- run: |
158+
node ./scripts/addPackageJsonGitHead.mjs package.json
154159
npm pack
155160
mv typescript*.tgz typescript.tgz
156161
echo "package=$PWD/typescript.tgz" >> "$GITHUB_OUTPUT"
@@ -176,11 +181,11 @@ jobs:
176181
if: github.event_name == 'pull_request'
177182

178183
steps:
179-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
184+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
180185
with:
181186
path: pr
182187

183-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
188+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
184189
with:
185190
path: base
186191
ref: ${{ github.base_ref }}
@@ -218,7 +223,7 @@ jobs:
218223
runs-on: ubuntu-latest
219224

220225
steps:
221-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
226+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
222227
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
223228
with:
224229
node-version: '*'
@@ -235,7 +240,7 @@ jobs:
235240
runs-on: ubuntu-latest
236241

237242
steps:
238-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
243+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
239244
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
240245
with:
241246
node-version: '*'
@@ -255,7 +260,7 @@ jobs:
255260
runs-on: ubuntu-latest
256261

257262
steps:
258-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
263+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
259264
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
260265
with:
261266
node-version: '*'
@@ -274,6 +279,7 @@ jobs:
274279
git add tests/baselines/reference
275280
276281
- name: Check baselines
282+
id: check-baselines
277283
run: |
278284
function print_diff() {
279285
if ! git diff --staged --exit-code --quiet --diff-filter=$1; then
@@ -286,5 +292,13 @@ jobs:
286292
print_diff ACR "Missing baselines"
287293
print_diff MTUXB "Modified baselines"
288294
print_diff D "Unused baselines"
295+
git diff --staged > fix_baselines.patch
289296
exit 1
290297
fi
298+
299+
- name: Upload baseline diff artifact
300+
if: ${{ failure() && steps.check-baselines.conclusion == 'failure' }}
301+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
302+
with:
303+
name: fix_baselines.patch
304+
path: fix_baselines.patch

.github/workflows/codeql.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242

4343
steps:
4444
- name: Checkout repository
45-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
49+
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
5050
with:
5151
config-file: ./.github/codeql/codeql-configuration.yml
5252
# Override language selection by uncommenting this and choosing your languages
@@ -56,7 +56,7 @@ jobs:
5656
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5757
# If this step fails, then you should remove it and run the build manually (see below).
5858
- name: Autobuild
59-
uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
59+
uses: github/codeql-action/autobuild@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
6060

6161
# ℹ️ Command-line programs to run using the OS shell.
6262
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# make release
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
73+
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3

.github/workflows/create-cherry-pick-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
if: github.repository == 'microsoft/TypeScript'
4848

4949
steps:
50-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
50+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
5151
with:
5252
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
5353
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none.

.github/workflows/insiders.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ jobs:
2020
if: github.repository == 'microsoft/TypeScript'
2121

2222
steps:
23-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
23+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2424
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
25+
with:
26+
node-version: 'lts/*'
2527
- run: |
2628
npm --version
2729
# corepack enable npm
@@ -40,9 +42,10 @@ jobs:
4042
if: github.repository == 'microsoft/TypeScript'
4143

4244
steps:
43-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
4446
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
4547
with:
48+
node-version: 'lts/*'
4649
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.
4750
registry-url: https://registry.npmjs.org/
4851
- run: |
@@ -56,6 +59,7 @@ jobs:
5659
npm ci
5760
npx hereby configure-insiders
5861
npx hereby LKG
62+
node ./scripts/addPackageJsonGitHead.mjs package.json
5963
npm publish --tag insiders
6064
env:
6165
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)