Skip to content

Commit

Permalink
Merge branch 'main' into fix/47969
Browse files Browse the repository at this point in the history
  • Loading branch information
navya9singh committed Sep 20, 2022
2 parents 906510e + 23746af commit 305f4bd
Show file tree
Hide file tree
Showing 2,390 changed files with 645,491 additions and 255,713 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Expand Up @@ -20,7 +20,6 @@ scripts/run.bat
scripts/word2md.js
scripts/buildProtocol.js
scripts/ior.js
scripts/authors.js
scripts/configurePrerelease.js
scripts/open-user-pr.js
scripts/open-cherry-pick-pr.js
Expand Down
18 changes: 18 additions & 0 deletions .eslintignore
@@ -1,4 +1,22 @@
**/node_modules/**
/built/local/**
/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/**
12 changes: 12 additions & 0 deletions .eslintplugin.js
@@ -0,0 +1,12 @@
const fs = require("fs");
const path = require("path");

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

module.exports = {
rules: Object.fromEntries(ruleFiles.map((p) => {
return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
})),
}
46 changes: 32 additions & 14 deletions .eslintrc.json
Expand Up @@ -2,7 +2,6 @@
"parser": "@typescript-eslint/parser",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
Expand All @@ -11,11 +10,23 @@
"es6": true
},
"plugins": [
"@typescript-eslint", "jsdoc", "no-null", "import"
"@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",
"@typescript-eslint/no-array-constructor": "error",

"brace-style": "off",
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
Expand Down Expand Up @@ -51,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 @@ -69,21 +82,23 @@
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",

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

// scripts/eslint/rules
"object-literal-surrounding-space": "error",
"no-type-assertion-whitespace": "error",
"type-operator-spacing": "error",
"only-arrow-functions": ["error", {
"local/object-literal-surrounding-space": "error",
"local/no-type-assertion-whitespace": "error",
"local/type-operator-spacing": "error",
"local/only-arrow-functions": ["error", {
"allowNamedFunctions": true ,
"allowDeclarations": true
}],
"no-double-space": "error",
"boolean-trivia": "error",
"no-in-operator": "error",
"simple-indent": "error",
"debug-assert": "error",
"no-keywords": "error",
"one-namespace-per-file": "error",
"local/no-double-space": "error",
"local/boolean-trivia": "error",
"local/no-in-operator": "error",
"local/simple-indent": "error",
"local/debug-assert": "error",
"local/no-keywords": "error",
"local/one-namespace-per-file": "error",

// eslint-plugin-import
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
Expand Down Expand Up @@ -132,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: 1 addition & 3 deletions .github/pr_owners.txt
@@ -1,16 +1,14 @@
sandersn
elibarzilay
weswigham
andrewbranch
RyanCavanaugh
sheetalkamat
orta
rbuckton
ahejlsberg
amcasey
jessetrinity
minestarks
armanio123
gabritto
jakebailey
DanielRosenwasser
navya9singh
41 changes: 28 additions & 13 deletions .github/workflows/ci.yml
Expand Up @@ -11,7 +11,7 @@ on:
- release-*

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
Expand All @@ -24,31 +24,46 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
- name: Use node version ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Remove existing TypeScript
run: |
npm uninstall typescript --no-save
npm uninstall tslint --no-save
- run: npm ci

# Re: https://github.com/actions/setup-node/pull/125
- name: Register Problem Matcher for TSC
run: echo "##[add-matcher].github/tsc.json"

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

lint:
runs-on: ubuntu-latest

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

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

browser-integration:
runs-on: ubuntu-latest

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

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

- name: Build local
run: gulp local

- name: Validate the browser can import TypeScript
run: gulp test-browser-integration
4 changes: 0 additions & 4 deletions .github/workflows/release-branch-artifact.yaml
Expand Up @@ -12,10 +12,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- name: Remove existing TypeScript
run: |
npm uninstall typescript --no-save
npm uninstall tslint --no-save
- name: npm install and test
run: |
npm ci
Expand Down
30 changes: 13 additions & 17 deletions .github/workflows/twoslash-repros.yaml
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 }}
7 changes: 5 additions & 2 deletions .github/workflows/update-package-lock.yaml
Expand Up @@ -14,15 +14,18 @@ jobs:

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

- name: Configure git and update package-lock.json
run: |
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
npm install --package-lock-only --ignore-scripts
rm package-lock.json
npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present.
git add -f package-lock.json
if git commit -m "Update package-lock.json"; then
git push
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -43,7 +43,6 @@ scripts/run.bat
scripts/word2md.js
scripts/buildProtocol.js
scripts/ior.js
scripts/authors.js
scripts/configurePrerelease.js
scripts/configureLanguageServiceBuild.js
scripts/open-user-pr.js
Expand All @@ -54,6 +53,7 @@ scripts/produceLKG.js
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
scripts/generateLocalizedDiagnosticMessages.js
scripts/request-pr-review.js
scripts/errorCheck.js
scripts/*.js.map
scripts/typings/
coverage/
Expand Down

0 comments on commit 305f4bd

Please sign in to comment.