Skip to content

Commit d7ebce2

Browse files
committed
Merge branch 'main' into bug/44896
2 parents 7b684c5 + 16156b1 commit d7ebce2

File tree

1,715 files changed

+613087
-249069
lines changed

Some content is hidden

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

1,715 files changed

+613087
-249069
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ scripts/run.bat
2020
scripts/word2md.js
2121
scripts/buildProtocol.js
2222
scripts/ior.js
23-
scripts/authors.js
2423
scripts/configurePrerelease.js
2524
scripts/open-user-pr.js
2625
scripts/open-cherry-pick-pr.js

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
/tests/**
44
/lib/**
55
/src/lib/*.generated.d.ts
6+
# Ignore all compiled script outputs
67
/scripts/*.js
8+
# But, not the ones that are hand-written.
9+
# TODO: remove once scripts are pure JS
10+
!/scripts/browserIntegrationTest.js
11+
!/scripts/createPlaygroundBuild.js
12+
!/scripts/failed-tests.js
13+
!/scripts/find-unused-diagnostic-messages.js
14+
!/scripts/lint-hooks.js
15+
!/scripts/perf-result-post.js
16+
!/scripts/post-vsts-artifact-comment.js
17+
!/scripts/regenerate-unicode-identifier-parts.js
18+
!/scripts/run-sequence.js
19+
!/scripts/update-experimental-branches.js
720
/scripts/eslint/built/**
821
/internal/**
922
/coverage/**

.eslintplugin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
5+
const ext = ".js";
6+
const ruleFiles = fs.readdirSync(rulesDir).filter((p) => p.endsWith(ext));
7+
8+
module.exports = {
9+
rules: Object.fromEntries(ruleFiles.map((p) => {
10+
return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
11+
})),
12+
}

.eslintrc.json

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"parser": "@typescript-eslint/parser",
33
"parserOptions": {
44
"warnOnUnsupportedTypeScriptVersion": false,
5-
"ecmaVersion": 6,
65
"sourceType": "module"
76
},
87
"env": {
@@ -11,7 +10,7 @@
1110
"es6": true
1211
},
1312
"plugins": [
14-
"@typescript-eslint", "jsdoc", "no-null", "import"
13+
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
1514
],
1615
"overrides": [
1716
// By default, the ESLint CLI only looks at .js files. But, it will also look at
@@ -22,11 +21,12 @@
2221
//
2322
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
2423
// that will work regardless of the below.
25-
{ "files": ["*.ts"] }
24+
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
2625
],
2726
"rules": {
2827
"@typescript-eslint/adjacent-overload-signatures": "error",
2928
"@typescript-eslint/array-type": "error",
29+
"@typescript-eslint/no-array-constructor": "error",
3030

3131
"brace-style": "off",
3232
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -62,12 +62,14 @@
6262
"@typescript-eslint/prefer-for-of": "error",
6363
"@typescript-eslint/prefer-function-type": "error",
6464
"@typescript-eslint/prefer-namespace-keyword": "error",
65+
"@typescript-eslint/prefer-as-const": "error",
6566

6667
"quotes": "off",
6768
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
6869

6970
"semi": "off",
7071
"@typescript-eslint/semi": "error",
72+
"@typescript-eslint/no-extra-semi": "error",
7173

7274
"space-before-function-paren": "off",
7375
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -80,21 +82,23 @@
8082
"@typescript-eslint/type-annotation-spacing": "error",
8183
"@typescript-eslint/unified-signatures": "error",
8284

85+
"@typescript-eslint/no-extra-non-null-assertion": "error",
86+
8387
// scripts/eslint/rules
84-
"object-literal-surrounding-space": "error",
85-
"no-type-assertion-whitespace": "error",
86-
"type-operator-spacing": "error",
87-
"only-arrow-functions": ["error", {
88+
"local/object-literal-surrounding-space": "error",
89+
"local/no-type-assertion-whitespace": "error",
90+
"local/type-operator-spacing": "error",
91+
"local/only-arrow-functions": ["error", {
8892
"allowNamedFunctions": true ,
8993
"allowDeclarations": true
9094
}],
91-
"no-double-space": "error",
92-
"boolean-trivia": "error",
93-
"no-in-operator": "error",
94-
"simple-indent": "error",
95-
"debug-assert": "error",
96-
"no-keywords": "error",
97-
"one-namespace-per-file": "error",
95+
"local/no-double-space": "error",
96+
"local/boolean-trivia": "error",
97+
"local/no-in-operator": "error",
98+
"local/simple-indent": "error",
99+
"local/debug-assert": "error",
100+
"local/no-keywords": "error",
101+
"local/one-namespace-per-file": "error",
98102

99103
// eslint-plugin-import
100104
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
@@ -143,6 +147,9 @@
143147
"quote-props": ["error", "consistent-as-needed"],
144148
"space-in-parens": "error",
145149
"unicode-bom": ["error", "never"],
146-
"use-isnan": "error"
150+
"use-isnan": "error",
151+
"no-prototype-builtins": "error",
152+
"no-self-assign": "error",
153+
"no-dupe-else-if": "error"
147154
}
148155
}

.github/workflows/ci.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- release-*
1212

1313
jobs:
14-
build:
14+
test:
1515
runs-on: ubuntu-latest
1616

1717
strategy:
@@ -24,27 +24,46 @@ jobs:
2424

2525
steps:
2626
- uses: actions/checkout@v3
27-
with:
28-
fetch-depth: 5
2927
- name: Use node version ${{ matrix.node-version }}
3028
uses: actions/setup-node@v3
3129
with:
3230
node-version: ${{ matrix.node-version }}
3331
check-latest: true
3432
- run: npm ci
3533

36-
# Re: https://github.com/actions/setup-node/pull/125
37-
- name: Register Problem Matcher for TSC
38-
run: echo "##[add-matcher].github/tsc.json"
39-
4034
- name: Tests
41-
run: npm test -- --no-lint
35+
run: npm test
36+
37+
lint:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- uses: actions/checkout@v3
42+
- uses: actions/setup-node@v3
43+
with:
44+
node-version: "*"
45+
check-latest: true
46+
- run: npm ci
4247

4348
- name: Linter
44-
run: npm run lint:ci
49+
run: npm run lint
50+
51+
browser-integration:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- uses: actions/checkout@v3
56+
- uses: actions/setup-node@v3
57+
with:
58+
node-version: "*"
59+
check-latest: true
60+
- run: npm ci
4561

4662
- name: Adding playwright
4763
run: npm install --no-save --no-package-lock playwright
4864

65+
- name: Build local
66+
run: gulp local
67+
4968
- name: Validate the browser can import TypeScript
5069
run: gulp test-browser-integration

.github/workflows/twoslash-repros.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,31 @@ on:
88
- cron: '0 8 * * *'
99
repository_dispatch:
1010
types: run-twoslash-repros
11-
issues:
12-
types:
13-
- labeled
1411
workflow_dispatch:
1512
inputs:
16-
bisect_issue:
17-
description: Triggers a bisect request on the given issue number instead of updating repros on all issues
13+
issue:
14+
description: Limits run to a single issue.
15+
required: false
16+
type: string
17+
bisect:
18+
description: If set, runs a git bisect on an existing repro. Requires 'issue' to be set. Value can be revision labels (e.g. `good v4.7.3 bad main`) or `true` to infer bisect range.
1819
required: false
1920
type: string
2021

2122
jobs:
2223
run:
23-
if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }}
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/setup-node@v3
27-
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
28-
with:
29-
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
30-
31-
bisect:
32-
if: ${{ github.event.label.name == 'Bisect Repro' || github.event.inputs.bisect_issue }}
24+
if: ${{ github.repository == 'microsoft/TypeScript' }}
3325
runs-on: ubuntu-latest
3426
steps:
35-
- uses: actions/checkout@v3
27+
- if: ${{ github.event.inputs.bisect }}
28+
uses: actions/checkout@v3
3629
with:
3730
fetch-depth: 0
31+
- if: ${{ !github.event.inputs.bisect }}
32+
uses: actions/checkout@v3
3833
- uses: actions/setup-node@v3
3934
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
4035
with:
4136
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
42-
bisect: ${{ github.event.issue.number || github.event.inputs.bisect_issue }}
37+
issue: ${{ github.event.inputs.issue }}
38+
bisect: ${{ github.event.inputs.bisect }}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17+
with:
18+
token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
1719
- uses: actions/setup-node@v3
1820
with:
1921
node-version: 16

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ scripts/run.bat
4343
scripts/word2md.js
4444
scripts/buildProtocol.js
4545
scripts/ior.js
46-
scripts/authors.js
4746
scripts/configurePrerelease.js
4847
scripts/configureLanguageServiceBuild.js
4948
scripts/open-user-pr.js

0 commit comments

Comments
 (0)