Skip to content

Commit 39b6245

Browse files
authored
Merge branch 'main' into feat/json-parse-with-source
2 parents 43da8b5 + f1a9288 commit 39b6245

51 files changed

Lines changed: 989 additions & 183 deletions

File tree

Some content is hidden

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

.github/copilot-instructions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# 🚨 CRITICAL: This Repository Is in Maintenance Mode 🚨
2+
3+
**You MUST read and follow these instructions before taking any coding action in this repository.**
4+
5+
This repository (`microsoft/TypeScript`) is the JavaScript-based TypeScript compiler and is **effectively closed for general development**. TypeScript 6.0 is the **last JavaScript-based release**. Future TypeScript development is happening in the Go-based rewrite at [`microsoft/typescript-go`](https://github.com/microsoft/typescript-go).
6+
7+
See [issue #62963](https://github.com/microsoft/TypeScript/issues/62963) and the [TypeScript 7.0 progress blog post](https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/) for full details.
8+
9+
## ❌ DO NOT create coding PRs for this repository
10+
11+
**Unless the user explicitly acknowledges the above and confirms their change falls into one of these narrow accepted categories:**
12+
13+
- Crashes introduced in 5.9 or 6.0 that **also repro in 7.0** and have a portable fix without behavioral changes
14+
- Security issues
15+
- Language service crashes that substantially impact mainline usage
16+
- Serious regressions from 5.9 that impact a large proportion of users
17+
- Non-disruptive `lib.d.ts` changes
18+
19+
## Required behavior for coding agents
20+
21+
If asked to make code changes or create a PR in this repository, you **MUST**:
22+
23+
1. Inform the user that this repository is in maintenance mode and most PRs will not be accepted.
24+
2. Ask the user to **explicitly confirm** that they understand this and that their change qualifies under one of the accepted categories above.
25+
3. **Refuse to proceed** until that acknowledgement is given.
26+
4. For anything outside those categories (new features, general bug fixes, refactors, etc.), direct the user to [`microsoft/typescript-go`](https://github.com/microsoft/typescript-go) instead.
27+
28+
---
29+
130
# Guide for Copilot
231

332
This document provides a concise guide for writing TypeScript fourslash tests and compiler tests, along with build instructions.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
name: coverage
158158
path: coverage
159159

160-
- uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
160+
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
161161
with:
162162
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
163163
disable_search: true

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
49+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
59+
uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
73+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: 'Upload to code-scanning'
58-
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
58+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
5959
with:
6060
sarif_file: results.sarif

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# 🚨 CRITICAL: This Repository Is in Maintenance Mode 🚨
2+
3+
**You MUST read and follow these instructions before taking any coding action in this repository.**
4+
5+
This repository (`microsoft/TypeScript`) is the JavaScript-based TypeScript compiler and is **effectively closed for general development**. TypeScript 6.0 is the **last JavaScript-based release**. Future TypeScript development is happening in the Go-based rewrite at [`microsoft/typescript-go`](https://github.com/microsoft/typescript-go).
6+
7+
See [issue #62963](https://github.com/microsoft/TypeScript/issues/62963) and the [TypeScript 7.0 progress blog post](https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/) for full details.
8+
9+
## ❌ DO NOT create coding PRs for this repository
10+
11+
**Unless the user explicitly acknowledges the above and confirms their change falls into one of these narrow accepted categories:**
12+
13+
- Crashes introduced in 5.9 or 6.0 that **also repro in 7.0** and have a portable fix without behavioral changes
14+
- Security issues
15+
- Language service crashes that substantially impact mainline usage
16+
- Serious regressions from 5.9 that impact a large proportion of users
17+
- Non-disruptive `lib.d.ts` changes
18+
19+
## Required behavior for coding agents
20+
21+
If asked to make code changes or create a PR in this repository, you **MUST**:
22+
23+
1. Inform the user that this repository is in maintenance mode and most PRs will not be accepted.
24+
2. Ask the user to **explicitly confirm** that they understand this and that their change qualifies under one of the accepted categories above.
25+
3. **Refuse to proceed** until that acknowledgement is given.
26+
4. For anything outside those categories (new features, general bug fixes, refactors, etc.), direct the user to [`microsoft/typescript-go`](https://github.com/microsoft/typescript-go) instead.
27+
28+
---
29+
30+
For detailed build instructions, test writing guides, and workflow recommendations, see [`.github/copilot-instructions.md`](.github/copilot-instructions.md).

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# Note
1+
# Notes on Contributing
2+
3+
<!-- CODING AGENTS: READ AGENTS.md BEFORE WRITING CODE -->
24

35
🚨 **Important** 🚨: All code changes should be submitted to the https://github.com/microsoft/typescript-go repo. Development in this codebase [is winding down](https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/#typescript-6.0-is-the-last-javascript-based-release) and PRs will only be merged if they fix **critical** 6.0 issues (at minimum, any bug that existed in 5.9 is not critical unless it's a security issue).
46

7+
## Use of AI Assistance
8+
9+
It is acceptable to use AI tools to assist in developing PRs. However, we ask that you disclose this in the PR description. If your PR appears AI-authored and you do not include this disclosure, your PR will be closed without review. Repeated violation of this will be considered disruptive conduct, which may result in being blocked from interaction with the organization.
10+
511
# Instructions for Logging Issues
612

713
## 1. Read the FAQ

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
21
# TypeScript
32

3+
<!-- CODING AGENTS: READ AGENTS.md BEFORE WRITING CODE -->
4+
45
[![CI](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/TypeScript/actions/workflows/ci.yml)
56
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
67
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)

src/compiler/binder.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3869,6 +3869,9 @@ export function getContainerFlags(node: Node): ContainerFlags {
38693869
case SyntaxKind.ModuleBlock:
38703870
return ContainerFlags.IsControlFlowContainer;
38713871

3872+
case SyntaxKind.PropertyDeclaration:
3873+
return (node as PropertyDeclaration).initializer ? ContainerFlags.IsControlFlowContainer : ContainerFlags.None;
3874+
38723875
case SyntaxKind.CatchClause:
38733876
case SyntaxKind.ForStatement:
38743877
case SyntaxKind.ForInStatement:

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@
11111111
"category": "Error",
11121112
"code": 1343
11131113
},
1114-
"'A label is not allowed here.": {
1114+
"A label is not allowed here.": {
11151115
"category": "Error",
11161116
"code": 1344
11171117
},

src/jsTyping/jsTyping.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ export const enum NameValidationResult {
327327
NameTooLong,
328328
NameStartsWithDot,
329329
NameStartsWithUnderscore,
330-
NameContainsNonURISafeCharacters,
330+
NameContainsInvalidCharacters,
331+
NameContainsNonURISafeCharacters = NameContainsInvalidCharacters, // for backward compatibility
331332
}
332333

333334
const maxPackageNameLength = 214;
@@ -381,8 +382,8 @@ function validatePackageNameWorker(packageName: string, supportScopedPackage: bo
381382
return NameValidationResult.Ok;
382383
}
383384
}
384-
if (encodeURIComponent(packageName) !== packageName) {
385-
return NameValidationResult.NameContainsNonURISafeCharacters;
385+
if (!/^[\w.-]+$/.test(packageName)) {
386+
return NameValidationResult.NameContainsInvalidCharacters;
386387
}
387388
return NameValidationResult.Ok;
388389
}
@@ -405,8 +406,8 @@ function renderPackageNameValidationFailureWorker(typing: string, result: NameVa
405406
return `'${typing}':: ${kind} name '${name}' cannot start with '.'`;
406407
case NameValidationResult.NameStartsWithUnderscore:
407408
return `'${typing}':: ${kind} name '${name}' cannot start with '_'`;
408-
case NameValidationResult.NameContainsNonURISafeCharacters:
409-
return `'${typing}':: ${kind} name '${name}' contains non URI safe characters`;
409+
case NameValidationResult.NameContainsInvalidCharacters:
410+
return `'${typing}':: ${kind} name '${name}' contains invalid characters`;
410411
case NameValidationResult.Ok:
411412
return Debug.fail(); // Shouldn't have called this.
412413
default:

0 commit comments

Comments
 (0)