Skip to content

Commit 2a075d6

Browse files
committed
Merge branch 'main' into partialModuleResolutionReuse
2 parents deaa5a4 + bbec17d commit 2a075d6

File tree

2,759 files changed

+664486
-261376
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,759 files changed

+664486
-261376
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1+
**/node_modules/**
12
/built/local/**
23
/tests/**
34
/lib/**
45
/src/lib/*.generated.d.ts
6+
# Ignore all compiled script outputs
7+
/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
20+
/scripts/eslint/built/**
21+
/internal/**
22+
/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: 32 additions & 14 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,11 +10,23 @@
1110
"es6": true
1211
},
1312
"plugins": [
14-
"@typescript-eslint", "jsdoc", "no-null", "import"
13+
"@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local"
14+
],
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"] }
1525
],
1626
"rules": {
1727
"@typescript-eslint/adjacent-overload-signatures": "error",
1828
"@typescript-eslint/array-type": "error",
29+
"@typescript-eslint/no-array-constructor": "error",
1930

2031
"brace-style": "off",
2132
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
@@ -51,12 +62,14 @@
5162
"@typescript-eslint/prefer-for-of": "error",
5263
"@typescript-eslint/prefer-function-type": "error",
5364
"@typescript-eslint/prefer-namespace-keyword": "error",
65+
"@typescript-eslint/prefer-as-const": "error",
5466

5567
"quotes": "off",
5668
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
5769

5870
"semi": "off",
5971
"@typescript-eslint/semi": "error",
72+
"@typescript-eslint/no-extra-semi": "error",
6073

6174
"space-before-function-paren": "off",
6275
"@typescript-eslint/space-before-function-paren": ["error", {
@@ -69,21 +82,23 @@
6982
"@typescript-eslint/type-annotation-spacing": "error",
7083
"@typescript-eslint/unified-signatures": "error",
7184

85+
"@typescript-eslint/no-extra-non-null-assertion": "error",
86+
7287
// scripts/eslint/rules
73-
"object-literal-surrounding-space": "error",
74-
"no-type-assertion-whitespace": "error",
75-
"type-operator-spacing": "error",
76-
"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", {
7792
"allowNamedFunctions": true ,
7893
"allowDeclarations": true
7994
}],
80-
"no-double-space": "error",
81-
"boolean-trivia": "error",
82-
"no-in-operator": "error",
83-
"simple-indent": "error",
84-
"debug-assert": "error",
85-
"no-keywords": "error",
86-
"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",
87102

88103
// eslint-plugin-import
89104
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
@@ -132,6 +147,9 @@
132147
"quote-props": ["error", "consistent-as-needed"],
133148
"space-in-parens": "error",
134149
"unicode-bom": ["error", "never"],
135-
"use-isnan": "error"
150+
"use-isnan": "error",
151+
"no-prototype-builtins": "error",
152+
"no-self-assign": "error",
153+
"no-dupe-else-if": "error"
136154
}
137155
}

.github/pr_owners.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
sandersn
2-
elibarzilay
32
weswigham
43
andrewbranch
54
RyanCavanaugh
65
sheetalkamat
7-
orta
86
rbuckton
97
ahejlsberg
108
amcasey
11-
jessetrinity
129
minestarks
1310
armanio123
1411
gabritto
1512
jakebailey
1613
DanielRosenwasser
14+
navya9singh

.github/tsc.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 28 additions & 13 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,31 +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
34-
- name: Remove existing TypeScript
35-
run: |
36-
npm uninstall typescript --no-save
37-
npm uninstall tslint --no-save
3832
- run: npm ci
3933

40-
# Re: https://github.com/actions/setup-node/pull/125
41-
- name: Register Problem Matcher for TSC
42-
run: echo "##[add-matcher].github/tsc.json"
43-
4434
- name: Tests
45-
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
4647

4748
- name: Linter
48-
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
4961

5062
- name: Adding playwright
5163
run: npm install --no-save --no-package-lock playwright
5264

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

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v3
15-
- name: Remove existing TypeScript
16-
run: |
17-
npm uninstall typescript --no-save
18-
npm uninstall tslint --no-save
1915
- name: npm install and test
2016
run: |
2117
npm ci

.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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ 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:
19-
node-version: 14
21+
node-version: 16
2022

2123
- name: Configure git and update package-lock.json
2224
run: |
2325
git config user.email "[email protected]"
2426
git config user.name "TypeScript Bot"
25-
npm install --package-lock-only --ignore-scripts
27+
rm package-lock.json
28+
npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present.
2629
git add -f package-lock.json
2730
if git commit -m "Update package-lock.json"; then
2831
git push

.gitignore

Lines changed: 1 addition & 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
@@ -54,6 +53,7 @@ scripts/produceLKG.js
5453
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
5554
scripts/generateLocalizedDiagnosticMessages.js
5655
scripts/request-pr-review.js
56+
scripts/errorCheck.js
5757
scripts/*.js.map
5858
scripts/typings/
5959
coverage/

0 commit comments

Comments
 (0)