Skip to content

Commit 668ccde

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/intra-expression-inference-with-resolved-calls
2 parents 299f264 + fb88f02 commit 668ccde

File tree

17,269 files changed

+1237879
-242835
lines changed

Some content is hidden

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

17,269 files changed

+1237879
-242835
lines changed

.dprint.jsonc

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
// If updating this, also update the config in dtsBundler.mjs.
23
"indentWidth": 4,
34
"lineWidth": 1000,
45
"newLineKind": "auto",
@@ -19,15 +20,14 @@
1920
"arrowFunction.useParentheses": "preferNone",
2021
"conditionalExpression.linePerExpression": false, // Keep our "match/case"-ish conditionals.
2122
"functionExpression.spaceAfterFunctionKeyword": true,
22-
"importDeclaration.forceMultiLine": true,
23+
"importDeclaration.forceMultiLine": "whenMultiple",
2324
"constructorType.spaceAfterNewKeyword": true,
2425
"constructSignature.spaceAfterNewKeyword": true,
2526

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"
27+
"module.sortImportDeclarations": "caseInsensitive",
28+
"module.sortExportDeclarations": "caseInsensitive",
29+
"exportDeclaration.sortNamedExports": "caseInsensitive",
30+
"importDeclaration.sortNamedImports": "caseInsensitive"
3131
},
3232
"prettier": {
3333
"newLineKind": "lf",
@@ -44,6 +44,7 @@
4444
"trailingCommas": "never"
4545
},
4646
"excludes": [
47+
"**/.git",
4748
"**/node_modules",
4849
"**/*-lock.json",
4950
"coverage/**",
@@ -52,12 +53,14 @@
5253
"tests/**",
5354
"internal/**",
5455
"**/*.generated.*",
55-
"scripts/*.d.*"
56+
"scripts/*.d.*",
57+
"**/_namespaces/**"
5658
],
5759
// Note: if adding new languages, make sure settings.template.json is updated too.
60+
// Also, if updating typescript, update the one in package.json.
5861
"plugins": [
59-
"https://plugins.dprint.dev/typescript-0.88.9.wasm",
60-
"https://plugins.dprint.dev/json-0.19.1.wasm",
61-
"https://plugins.dprint.dev/prettier-0.35.0.json@0df49c4d878bb1051af2fa1d1f69ba6400f4b78633f49baa1f38954a6fd32b40"
62+
"https://plugins.dprint.dev/typescript-0.91.1.wasm",
63+
"https://plugins.dprint.dev/json-0.19.3.wasm",
64+
"https://plugins.dprint.dev/prettier-0.40.0.json@68c668863ec834d4be0f6f5ccaab415df75336a992aceb7eeeb14fdf096a9e9c"
6265
]
6366
}

.eslintrc.json

+16-19
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",
@@ -134,13 +145,7 @@
134145
"local/debug-assert": "error",
135146
"local/no-keywords": "error",
136147
"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"
148+
"local/js-extensions": "error"
144149
},
145150
"overrides": [
146151
// By default, the ESLint CLI only looks at .js files. But, it will also look at
@@ -167,14 +172,6 @@
167172
{ "name": "exports" }
168173
]
169174
}
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-
}
178175
}
179176
]
180177
}

.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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
180185
with:
181186
path: pr
182187

183-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
188+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
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@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
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@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
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@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8

0 commit comments

Comments
 (0)