Skip to content

Commit 7ab89e5

Browse files
Merge remote-tracking branch 'origin/main' into release-4.9
2 parents 549b542 + e5cd686 commit 7ab89e5

File tree

2,104 files changed

+69383
-50003
lines changed

Some content is hidden

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

2,104 files changed

+69383
-50003
lines changed

.dockerignore

+2-14
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,8 @@ build.json
1717
*.config
1818
scripts/debug.bat
1919
scripts/run.bat
20-
scripts/word2md.js
21-
scripts/buildProtocol.js
22-
scripts/ior.js
23-
scripts/configurePrerelease.js
24-
scripts/open-user-pr.js
25-
scripts/open-cherry-pick-pr.js
26-
scripts/processDiagnosticMessages.d.ts
27-
scripts/processDiagnosticMessages.js
28-
scripts/produceLKG.js
29-
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
30-
scripts/generateLocalizedDiagnosticMessages.js
31-
scripts/configureLanguageServiceBuild.js
32-
scripts/*.js.map
33-
scripts/typings/
20+
scripts/**/*.js
21+
scripts/**/*.js.map
3422
coverage/
3523
internal/
3624
**/.DS_Store

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
/lib/**
55
/src/lib/*.generated.d.ts
66
# Ignore all compiled script outputs
7-
/scripts/*.js
7+
/scripts/**/*.js
8+
/scripts/**/*.d.*
89
# But, not the ones that are hand-written.
910
# TODO: remove once scripts are pure JS
1011
!/scripts/browserIntegrationTest.js

.eslintplugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require("fs");
22
const path = require("path");
33

44
const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
5-
const ext = ".js";
5+
const ext = ".cjs";
66
const ruleFiles = fs.readdirSync(rulesDir).filter((p) => p.endsWith(ext));
77

88
module.exports = {

.eslintrc.json

+27-12
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@
1212
"plugins": [
1313
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
1414
],
15-
"overrides": [
16-
// By default, the ESLint CLI only looks at .js files. But, it will also look at
17-
// any files which are referenced in an override config. Most users of typescript-eslint
18-
// get this behavior by default by extending a recommended typescript-eslint config, which
19-
// just so happens to override some core ESLint rules. We don't extend from any config, so
20-
// explicitly reference TS files here so the CLI picks them up.
21-
//
22-
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
23-
// that will work regardless of the below.
24-
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
25-
],
2615
"rules": {
2716
"@typescript-eslint/adjacent-overload-signatures": "error",
2817
"@typescript-eslint/array-type": "error",
@@ -151,5 +140,31 @@
151140
"no-prototype-builtins": "error",
152141
"no-self-assign": "error",
153142
"no-dupe-else-if": "error"
154-
}
143+
},
144+
"overrides": [
145+
// By default, the ESLint CLI only looks at .js files. But, it will also look at
146+
// any files which are referenced in an override config. Most users of typescript-eslint
147+
// get this behavior by default by extending a recommended typescript-eslint config, which
148+
// just so happens to override some core ESLint rules. We don't extend from any config, so
149+
// explicitly reference TS files here so the CLI picks them up.
150+
//
151+
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
152+
// that will work regardless of the below.
153+
//
154+
// The same applies to mjs files; ESLint appears to not scan those either.
155+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
156+
{
157+
"files": ["*.mjs", "*.mts"],
158+
"rules": {
159+
// These globals don't exist outside of CJS files.
160+
"no-restricted-globals": ["error",
161+
{ "name": "__filename" },
162+
{ "name": "__dirname" },
163+
{ "name": "require" },
164+
{ "name": "module" },
165+
{ "name": "exports" }
166+
]
167+
}
168+
}
169+
]
155170
}
+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name : CodeQL Configuration
22

33
paths:
4-
- './src'
4+
- src
5+
- scripts
6+
- Gulpfile.mjs
7+
paths-ignore:
8+
- src/lib

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313

1414
- name: Configure Git, Run Tests, Update Baselines, Apply Fixes

.github/workflows/ci.yml

+17
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,20 @@ jobs:
6767

6868
- name: Validate the browser can import TypeScript
6969
run: gulp test-browser-integration
70+
71+
misc:
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@v3
76+
- uses: actions/setup-node@v3
77+
with:
78+
node-version: "*"
79+
check-latest: true
80+
- run: npm ci
81+
82+
- name: Build scripts
83+
run: gulp scripts
84+
85+
- name: ESLint tests
86+
run: gulp run-eslint-rules-tests

.github/workflows/codeql.yml

+52-38
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,64 @@
1-
name: "Code scanning - action"
1+
name: "Code Scanning - Action"
22

33
on:
44
push:
5+
branches:
6+
- main
7+
- release-*
58
pull_request:
9+
branches:
10+
- main
11+
- release-*
612
schedule:
7-
- cron: '0 19 * * 0'
13+
# ┌───────────── minute (0 - 59)
14+
# │ ┌───────────── hour (0 - 23)
15+
# │ │ ┌───────────── day of the month (1 - 31)
16+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
17+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
18+
# │ │ │ │ │
19+
# │ │ │ │ │
20+
# │ │ │ │ │
21+
# * * * * *
22+
- cron: '30 1 * * 0'
823

924
jobs:
1025
CodeQL-Build:
11-
12-
# CodeQL runs on ubuntu-latest and windows-latest
26+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
1327
runs-on: ubuntu-latest
1428
if: github.repository == 'microsoft/TypeScript'
1529

30+
permissions:
31+
# required for all workflows
32+
security-events: write
33+
1634
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v2
19-
with:
20-
# We must fetch at least the immediate parents so that if this is
21-
# a pull request then we can checkout the head.
22-
fetch-depth: 2
23-
24-
# Initializes the CodeQL tools for scanning.
25-
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@v1
27-
with:
28-
config-file: ./.github/codeql/codeql-configuration.yml
29-
# Override language selection by uncommenting this and choosing your languages
30-
# with:
31-
# languages: go, javascript, csharp, python, cpp, java
32-
33-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
34-
# If this step fails, then you should remove it and run the build manually (see below)
35-
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v1
37-
38-
# ℹ️ Command-line programs to run using the OS shell.
39-
# 📚 https://git.io/JvXDl
40-
41-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
42-
# and modify them (or add more) to build your code if your project
43-
# uses a compiled language
44-
45-
#- run: |
46-
# make bootstrap
47-
# make release
48-
49-
- name: Perform CodeQL Analysis
50-
uses: github/codeql-action/analyze@v1
35+
- name: Checkout repository
36+
uses: actions/checkout@v3
37+
38+
# Initializes the CodeQL tools for scanning.
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/init@v2
41+
with:
42+
config-file: ./.github/codeql/codeql-configuration.yml
43+
# Override language selection by uncommenting this and choosing your languages
44+
# with:
45+
# languages: go, javascript, csharp, python, cpp, java
46+
47+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48+
# If this step fails, then you should remove it and run the build manually (see below).
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v2
51+
52+
# ℹ️ Command-line programs to run using the OS shell.
53+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
54+
55+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
56+
# three lines and modify them (or add more) to build your code if your
57+
# project uses a compiled language
58+
59+
#- run: |
60+
# make bootstrap
61+
# make release
62+
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v2

.github/workflows/ensure-related-repos-run-crons.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
git config --global user.email "[email protected]"
2323
git config --global user.name "TypeScript Bot"
2424
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
with:
2727
repository: 'microsoft/TypeScript-Website'
2828
path: 'ts-site'
@@ -34,7 +34,7 @@ jobs:
3434
git config --unset-all http.https://github.com/.extraheader
3535
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Website.git
3636
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
with:
3939
repository: 'microsoft/TypeScript-Make-Monaco-Builds'
4040
path: 'monaco-builds'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "typescript-error-deltas Watchdog"
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 3' # Every Wednesday
7+
8+
jobs:
9+
check-for-recent:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'microsoft/TypeScript'
12+
permissions:
13+
contents: read # Apparently required to create issues
14+
issues: write
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
TAGS: "@RyanCavanaugh @DanielRosenwasser @amcasey"
18+
steps:
19+
- name: NewErrors
20+
run: | # --json and --jq prints exactly one issue number per line of output
21+
DATE=$(date --date="7 days ago" --iso-8601)
22+
gh issue list --repo microsoft/typescript --search "[NewErrors] created:>=$DATE" --state all --json number --jq ".[].number" \
23+
| grep -qe "[0-9]" \
24+
|| gh issue create --repo ${{ github.repository }} --title "No NewErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=48)."
25+
- name: ServerErrors TS
26+
run: |
27+
DATE=$(date --date="7 days ago" --iso-8601)
28+
gh issue list --repo microsoft/typescript --search "[ServerErrors][TypeScript] created:>=$DATE" --state all --json number --jq ".[].number" \
29+
| grep -qe "[0-9]" \
30+
|| gh issue create --repo ${{ github.repository }} --title "No TypeScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=59)."
31+
- name: ServerErrors JS
32+
run: |
33+
DATE=$(date --date="7 days ago" --iso-8601)
34+
gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \
35+
| grep -qe "[0-9]" \
36+
|| gh issue create --repo ${{ github.repository }} --title "No JavaScript ServerErrors issue since $DATE" --body "$TAGS Please check the [pipeline](https://typescript.visualstudio.com/TypeScript/_build?definitionId=58)."

.github/workflows/new-release-branch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- uses: actions/setup-node@v3
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
fetch-depth: 5
1616
- run: |

.github/workflows/nightly.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: github.repository == 'microsoft/TypeScript'
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
2020
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.

.github/workflows/release-branch-artifact.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- uses: actions/setup-node@v3
1515
- name: npm install and test
1616
run: |
@@ -27,7 +27,7 @@ jobs:
2727
npm pack ./
2828
mv typescript-*.tgz typescript.tgz
2929
- name: Upload built tarfile
30-
uses: actions/upload-artifact@v1
30+
uses: actions/upload-artifact@v3
3131
with:
3232
name: tgz
3333
path: typescript.tgz

.github/workflows/rich-navigation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: windows-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 5
2121

.github/workflows/set-version.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- uses: actions/setup-node@v3
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
with:
1515
ref: ${{ github.event.client_payload.branch_name }}
1616
# notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists

.github/workflows/sync-branch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- uses: actions/setup-node@v3
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
with:
2020
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
2121
fetch-depth: 0

.github/workflows/sync-wiki.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
- name: Get repo name
1010
run: R=${GITHUB_REPOSITORY%?wiki}; echo "BASENAME=${R##*/}" >> $GITHUB_ENV
1111
- name: Checkout ${{ env.BASENAME }}-wiki
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v3
1313
with:
1414
repository: "${{ GITHUB.repository_owner }}/${{ env.BASENAME }}-wiki"
1515
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}

.github/workflows/update-lkg.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313

1414
- name: Configure Git and Update LKG

.github/workflows/update-package-lock.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
if: github.repository == 'microsoft/TypeScript'
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
with:
1818
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
1919
- uses: actions/setup-node@v3

0 commit comments

Comments
 (0)