Skip to content

Commit a3ec9ee

Browse files
committed
Merge branch 'main' into decorators-stage-3
2 parents 86e0cd2 + 16156b1 commit a3ec9ee

File tree

1,110 files changed

+368614
-63770
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,110 files changed

+368614
-63770
lines changed

.eslintignore

+13
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/**

.eslintrc.json

+10-3
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": {
@@ -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,6 +82,8 @@
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
8488
"local/object-literal-surrounding-space": "error",
8589
"local/no-type-assertion-whitespace": "error",
@@ -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

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- run: npm ci
3333

3434
- name: Tests
35-
run: npm test -- --no-lint
35+
run: npm test
3636

3737
lint:
3838
runs-on: ubuntu-latest
@@ -46,7 +46,7 @@ jobs:
4646
- run: npm ci
4747

4848
- name: Linter
49-
run: npm run lint:ci
49+
run: npm run lint
5050

5151
browser-integration:
5252
runs-on: ubuntu-latest

.github/workflows/twoslash-repros.yaml

+13-17
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 }}

Gulpfile.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@ const lint = eslint(".");
372372
lint.displayName = "lint";
373373
task("lint", lint);
374374
task("lint").description = "Runs eslint on the compiler and scripts sources.";
375-
task("lint").flags = {
376-
" --ci": "Runs eslint additional rules",
377-
};
378375

379376
const buildCancellationToken = () => buildProject("src/cancellationToken");
380377
const cleanCancellationToken = () => cleanProject("src/cancellationToken");
@@ -427,10 +424,8 @@ task("watch-local").flags = {
427424
const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
428425
preTest.displayName = "preTest";
429426

430-
const postTest = (done) => cmdLineOptions.lint ? lint() : done();
431-
432427
const runTests = () => runConsoleTests("built/local/run.js", "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false);
433-
task("runtests", series(preBuild, preTest, runTests, postTest));
428+
task("runtests", series(preBuild, preTest, runTests));
434429
task("runtests").description = "Runs the tests using the built run.js file.";
435430
task("runtests").flags = {
436431
"-t --tests=<regex>": "Pattern for tests to run.",
@@ -442,18 +437,16 @@ task("runtests").flags = {
442437
" --dirty": "Run tests without first cleaning test output directories",
443438
" --stackTraceLimit=<limit>": "Sets the maximum number of stack frames to display. Use 'full' to show all frames.",
444439
" --no-color": "Disables color",
445-
" --no-lint": "Disables lint",
446440
" --timeout=<ms>": "Overrides the default test timeout.",
447441
" --built": "Compile using the built version of the compiler.",
448442
" --shards": "Total number of shards running tests (default: 1)",
449443
" --shardId": "1-based ID of this shard (default: 1)",
450444
};
451445

452446
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
453-
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
447+
task("runtests-parallel", series(preBuild, preTest, runTestsParallel));
454448
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
455449
task("runtests-parallel").flags = {
456-
" --no-lint": "disables lint.",
457450
" --light": "Run tests in light mode (fewer verifications, but tests run faster).",
458451
" --keepFailed": "Keep tests in .failed-tests even if they pass.",
459452
" --dirty": "Run tests without first cleaning test output directories.",
@@ -616,7 +609,6 @@ task("watch").flags = {
616609
" --dirty": "Run tests without first cleaning test output directories",
617610
" --stackTraceLimit=<limit>": "Sets the maximum number of stack frames to display. Use 'full' to show all frames.",
618611
" --no-color": "Disables color",
619-
" --no-lint": "Disables lint",
620612
" --timeout=<ms>": "Overrides the default test timeout.",
621613
" --workers=<number>": "The number of parallel workers to use.",
622614
" --built": "Compile using the built version of the compiler.",

0 commit comments

Comments
 (0)