Skip to content

Commit

Permalink
Merge branch 'main' into decorators-stage-3
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Sep 20, 2022
2 parents 86e0cd2 + 16156b1 commit a3ec9ee
Show file tree
Hide file tree
Showing 1,110 changed files with 368,614 additions and 63,770 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
/tests/**
/lib/**
/src/lib/*.generated.d.ts
# Ignore all compiled script outputs
/scripts/*.js
# But, not the ones that are hand-written.
# TODO: remove once scripts are pure JS
!/scripts/browserIntegrationTest.js
!/scripts/createPlaygroundBuild.js
!/scripts/failed-tests.js
!/scripts/find-unused-diagnostic-messages.js
!/scripts/lint-hooks.js
!/scripts/perf-result-post.js
!/scripts/post-vsts-artifact-comment.js
!/scripts/regenerate-unicode-identifier-parts.js
!/scripts/run-sequence.js
!/scripts/update-experimental-branches.js
/scripts/eslint/built/**
/internal/**
/coverage/**
13 changes: 10 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
Expand All @@ -22,11 +21,12 @@
//
// 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"] }
{ "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/no-array-constructor": "error",

"brace-style": "off",
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
Expand Down Expand Up @@ -62,12 +62,14 @@
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-as-const": "error",

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

"semi": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/no-extra-semi": "error",

"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": ["error", {
Expand All @@ -80,6 +82,8 @@
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",

"@typescript-eslint/no-extra-non-null-assertion": "error",

// scripts/eslint/rules
"local/object-literal-surrounding-space": "error",
"local/no-type-assertion-whitespace": "error",
Expand Down Expand Up @@ -143,6 +147,9 @@
"quote-props": ["error", "consistent-as-needed"],
"space-in-parens": "error",
"unicode-bom": ["error", "never"],
"use-isnan": "error"
"use-isnan": "error",
"no-prototype-builtins": "error",
"no-self-assign": "error",
"no-dupe-else-if": "error"
}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- run: npm ci

- name: Tests
run: npm test -- --no-lint
run: npm test

lint:
runs-on: ubuntu-latest
Expand All @@ -46,7 +46,7 @@ jobs:
- run: npm ci

- name: Linter
run: npm run lint:ci
run: npm run lint

browser-integration:
runs-on: ubuntu-latest
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/twoslash-repros.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,31 @@ on:
- cron: '0 8 * * *'
repository_dispatch:
types: run-twoslash-repros
issues:
types:
- labeled
workflow_dispatch:
inputs:
bisect_issue:
description: Triggers a bisect request on the given issue number instead of updating repros on all issues
issue:
description: Limits run to a single issue.
required: false
type: string
bisect:
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.
required: false
type: string

jobs:
run:
if: ${{ github.repository == 'microsoft/TypeScript' && !github.event.label && !github.event.inputs.bisect_issue }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}

bisect:
if: ${{ github.event.label.name == 'Bisect Repro' || github.event.inputs.bisect_issue }}
if: ${{ github.repository == 'microsoft/TypeScript' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- if: ${{ github.event.inputs.bisect }}
uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ !github.event.inputs.bisect }}
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
bisect: ${{ github.event.issue.number || github.event.inputs.bisect_issue }}
issue: ${{ github.event.inputs.issue }}
bisect: ${{ github.event.inputs.bisect }}
12 changes: 2 additions & 10 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,6 @@ const lint = eslint(".");
lint.displayName = "lint";
task("lint", lint);
task("lint").description = "Runs eslint on the compiler and scripts sources.";
task("lint").flags = {
" --ci": "Runs eslint additional rules",
};

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

const postTest = (done) => cmdLineOptions.lint ? lint() : done();

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

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

0 comments on commit a3ec9ee

Please sign in to comment.