Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release-4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRosenwasser committed Oct 30, 2022
2 parents 549b542 + e5cd686 commit 7ab89e5
Show file tree
Hide file tree
Showing 2,104 changed files with 69,383 additions and 50,003 deletions.
16 changes: 2 additions & 14 deletions .dockerignore
Expand Up @@ -17,20 +17,8 @@ build.json
*.config
scripts/debug.bat
scripts/run.bat
scripts/word2md.js
scripts/buildProtocol.js
scripts/ior.js
scripts/configurePrerelease.js
scripts/open-user-pr.js
scripts/open-cherry-pick-pr.js
scripts/processDiagnosticMessages.d.ts
scripts/processDiagnosticMessages.js
scripts/produceLKG.js
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
scripts/generateLocalizedDiagnosticMessages.js
scripts/configureLanguageServiceBuild.js
scripts/*.js.map
scripts/typings/
scripts/**/*.js
scripts/**/*.js.map
coverage/
internal/
**/.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion .eslintignore
Expand Up @@ -4,7 +4,8 @@
/lib/**
/src/lib/*.generated.d.ts
# Ignore all compiled script outputs
/scripts/*.js
/scripts/**/*.js
/scripts/**/*.d.*
# But, not the ones that are hand-written.
# TODO: remove once scripts are pure JS
!/scripts/browserIntegrationTest.js
Expand Down
2 changes: 1 addition & 1 deletion .eslintplugin.js
Expand Up @@ -2,7 +2,7 @@ const fs = require("fs");
const path = require("path");

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

module.exports = {
Expand Down
39 changes: 27 additions & 12 deletions .eslintrc.json
Expand Up @@ -12,17 +12,6 @@
"plugins": [
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
],
"overrides": [
// By default, the ESLint CLI only looks at .js files. But, it will also look at
// any files which are referenced in an override config. Most users of typescript-eslint
// get this behavior by default by extending a recommended typescript-eslint config, which
// just so happens to override some core ESLint rules. We don't extend from any config, so
// explicitly reference TS files here so the CLI picks them up.
//
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
// that will work regardless of the below.
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
Expand Down Expand Up @@ -151,5 +140,31 @@
"no-prototype-builtins": "error",
"no-self-assign": "error",
"no-dupe-else-if": "error"
}
},
"overrides": [
// By default, the ESLint CLI only looks at .js files. But, it will also look at
// any files which are referenced in an override config. Most users of typescript-eslint
// get this behavior by default by extending a recommended typescript-eslint config, which
// just so happens to override some core ESLint rules. We don't extend from any config, so
// explicitly reference TS files here so the CLI picks them up.
//
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
// that will work regardless of the below.
//
// The same applies to mjs files; ESLint appears to not scan those either.
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] },
{
"files": ["*.mjs", "*.mts"],
"rules": {
// These globals don't exist outside of CJS files.
"no-restricted-globals": ["error",
{ "name": "__filename" },
{ "name": "__dirname" },
{ "name": "require" },
{ "name": "module" },
{ "name": "exports" }
]
}
}
]
}
6 changes: 5 additions & 1 deletion .github/codeql/codeql-configuration.yml
@@ -1,4 +1,8 @@
name : CodeQL Configuration

paths:
- './src'
- src
- scripts
- Gulpfile.mjs
paths-ignore:
- src/lib
2 changes: 1 addition & 1 deletion .github/workflows/accept-baselines-fix-lints.yaml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Configure Git, Run Tests, Update Baselines, Apply Fixes
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -67,3 +67,20 @@ jobs:

- name: Validate the browser can import TypeScript
run: gulp test-browser-integration

misc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "*"
check-latest: true
- run: npm ci

- name: Build scripts
run: gulp scripts

- name: ESLint tests
run: gulp run-eslint-rules-tests
90 changes: 52 additions & 38 deletions .github/workflows/codeql.yml
@@ -1,50 +1,64 @@
name: "Code scanning - action"
name: "Code Scanning - Action"

on:
push:
branches:
- main
- release-*
pull_request:
branches:
- main
- release-*
schedule:
- cron: '0 19 * * 0'
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
CodeQL-Build:

# CodeQL runs on ubuntu-latest and windows-latest
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'

permissions:
# required for all workflows
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
config-file: ./.github/codeql/codeql-configuration.yml
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-configuration.yml
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 2 additions & 2 deletions .github/workflows/ensure-related-repos-run-crons.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
git config --global user.email "typescriptbot@microsoft.com"
git config --global user.name "TypeScript Bot"
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: 'microsoft/TypeScript-Website'
path: 'ts-site'
Expand All @@ -34,7 +34,7 @@ jobs:
git config --unset-all http.https://github.com/.extraheader
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Website.git
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: 'microsoft/TypeScript-Make-Monaco-Builds'
path: 'monaco-builds'
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/error-deltas-watchdog.yaml
@@ -0,0 +1,36 @@
name: "typescript-error-deltas Watchdog"

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 3' # Every Wednesday

jobs:
check-for-recent:
runs-on: ubuntu-latest
if: github.repository == 'microsoft/TypeScript'
permissions:
contents: read # Apparently required to create issues
issues: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAGS: "@RyanCavanaugh @DanielRosenwasser @amcasey"
steps:
- name: NewErrors
run: | # --json and --jq prints exactly one issue number per line of output
DATE=$(date --date="7 days ago" --iso-8601)
gh issue list --repo microsoft/typescript --search "[NewErrors] created:>=$DATE" --state all --json number --jq ".[].number" \
| grep -qe "[0-9]" \
|| 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)."
- name: ServerErrors TS
run: |
DATE=$(date --date="7 days ago" --iso-8601)
gh issue list --repo microsoft/typescript --search "[ServerErrors][TypeScript] created:>=$DATE" --state all --json number --jq ".[].number" \
| grep -qe "[0-9]" \
|| 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)."
- name: ServerErrors JS
run: |
DATE=$(date --date="7 days ago" --iso-8601)
gh issue list --repo microsoft/typescript --search "[ServerErrors][JavaScript] created:>=$DATE" --state all --json number --jq ".[].number" \
| grep -qe "[0-9]" \
|| 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)."
2 changes: 1 addition & 1 deletion .github/workflows/new-release-branch.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 5
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yaml
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.repository == 'microsoft/TypeScript'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
# Use NODE_AUTH_TOKEN environment variable to authenticate to this registry.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-branch-artifact.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: npm install and test
run: |
Expand All @@ -27,7 +27,7 @@ jobs:
npm pack ./
mv typescript-*.tgz typescript.tgz
- name: Upload built tarfile
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: tgz
path: typescript.tgz
2 changes: 1 addition & 1 deletion .github/workflows/rich-navigation.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 5

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/set-version.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch_name }}
# notably, this is essentially the same script as `new-release-branch.yaml` (with fewer inputs), but it assumes the branch already exists
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-branch.yaml
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-wiki.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Get repo name
run: R=${GITHUB_REPOSITORY%?wiki}; echo "BASENAME=${R##*/}" >> $GITHUB_ENV
- name: Checkout ${{ env.BASENAME }}-wiki
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: "${{ GITHUB.repository_owner }}/${{ env.BASENAME }}-wiki"
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-lkg.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Configure Git and Update LKG
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-package-lock.yaml
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository == 'microsoft/TypeScript'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
- uses: actions/setup-node@v3
Expand Down

0 comments on commit 7ab89e5

Please sign in to comment.