Skip to content

Commit

Permalink
Merge branch 'main' into enumImprovements
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Aug 29, 2022
2 parents 66df808 + c89f355 commit 50a952b
Show file tree
Hide file tree
Showing 1,262 changed files with 271,709 additions and 192,850 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
**/node_modules/**
/built/local/**
/tests/**
/lib/**
/src/lib/*.generated.d.ts
/scripts/*.js
/scripts/eslint/built/**
/internal/**
/coverage/**
12 changes: 12 additions & 0 deletions .eslintplugin.js
Original file line number Diff line number Diff line change
@@ -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))];
})),
}
35 changes: 23 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@
"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"] }
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
Expand Down Expand Up @@ -70,20 +81,20 @@
"@typescript-eslint/unified-signatures": "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
4 changes: 1 addition & 3 deletions .github/pr_owners.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
sandersn
elibarzilay
weswigham
andrewbranch
RyanCavanaugh
sheetalkamat
orta
rbuckton
ahejlsberg
amcasey
jessetrinity
minestarks
armanio123
gabritto
jakebailey
DanielRosenwasser
navya9singh
37 changes: 26 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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

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

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
Original file line number Diff line number Diff line change
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
7 changes: 5 additions & 2 deletions .github/workflows/update-package-lock.yaml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 50a952b

Please sign in to comment.