Skip to content

Commit 2e77e93

Browse files
committed
Merge branch 'master' into abstractConstructSignatures
# Conflicts: # src/compiler/parser.ts # src/compiler/types.ts
2 parents 65a49a7 + 1508446 commit 2e77e93

File tree

2,840 files changed

+467999
-340337
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,840 files changed

+467999
-340337
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ yarn-error.log
4343
.parallelperf.*
4444
.failed-tests
4545
TEST-results.xml
46-
package-lock.json
4746
tests
4847
.vscode
4948
.git

.eslintrc.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
1818
"@typescript-eslint/array-type": "error",
1919

2020
"camelcase": "off",
21-
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
21+
"@typescript-eslint/naming-convention": [
22+
"error",
23+
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
24+
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false }, "filter": { "regex": "^I(Arguments|TextWriter|O([A-Z][a-z]+[A-Za-z]*)?)$", "match": false } },
25+
{ "selector": "variable", "format": ["camelCase", "PascalCase", "UPPER_CASE"], "leadingUnderscore": "allow", "filter": { "regex": "^(_{1,2}filename|_{1,2}dirname|_+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
26+
{ "selector": "function", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
27+
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", "match": false } },
28+
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
29+
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
30+
{ "selector": "enumMember", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
31+
{ "selector": "property", "format": null }
32+
],
2233

23-
"@typescript-eslint/class-name-casing": "error",
2434
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
25-
"@typescript-eslint/interface-name-prefix": "error",
2635
"@typescript-eslint/no-inferrable-types": "error",
2736
"@typescript-eslint/no-misused-new": "error",
2837
"@typescript-eslint/no-this-alias": "error",
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name : CodeQL Configuration
2+
3+
paths:
4+
- './src'

.github/tsc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "tsc",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"code": 5,
13+
"message": 6
14+
}
15+
]
16+
}
17+
]
18+
}

.github/workflows/ci.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [10.x, 12.x, 13.x]
19+
node-version: [10.x, 12.x, 14.x]
2020

2121
steps:
22-
- uses: actions/checkout@v1
22+
- uses: actions/checkout@v2
2323
with:
2424
fetch-depth: 5
2525
- name: Use node version ${{ matrix.node-version }}
@@ -30,12 +30,18 @@ jobs:
3030
run: |
3131
npm uninstall typescript --no-save
3232
npm uninstall tslint --no-save
33-
- name: npm install and test
34-
run: |
35-
npm install
36-
npm update
37-
npm test
38-
33+
- run: npm ci
34+
35+
# Re: https://github.com/actions/setup-node/pull/125
36+
- name: Register Problem Matcher for TSC
37+
run: echo "##[add-matcher].github/tsc.json"
38+
39+
- name: Tests
40+
run: npm test -- --no-lint
41+
42+
- name: Linter
43+
run: npm run lint:ci
44+
3945
- name: Validate the browser can import TypeScript
4046
run: gulp test-browser-integration
41-
47+

.github/workflows/codeql.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "Code scanning - action"
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 19 * * 0'
8+
9+
jobs:
10+
CodeQL-Build:
11+
12+
# CodeQL runs on ubuntu-latest and windows-latest
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
18+
with:
19+
# We must fetch at least the immediate parents so that if this is
20+
# a pull request then we can checkout the head.
21+
fetch-depth: 2
22+
23+
# If this run was triggered by a pull request event, then checkout
24+
# the head of the pull request instead of the merge commit.
25+
- run: git checkout HEAD^2
26+
if: ${{ github.event_name == 'pull_request' }}
27+
28+
# Initializes the CodeQL tools for scanning.
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v1
31+
with:
32+
config-file: ./.github/codeql/codeql-configuration.yml
33+
# Override language selection by uncommenting this and choosing your languages
34+
# with:
35+
# languages: go, javascript, csharp, python, cpp, java
36+
37+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
38+
# If this step fails, then you should remove it and run the build manually (see below)
39+
- name: Autobuild
40+
uses: github/codeql-action/autobuild@v1
41+
42+
# ℹ️ Command-line programs to run using the OS shell.
43+
# 📚 https://git.io/JvXDl
44+
45+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
46+
# and modify them (or add more) to build your code if your project
47+
# uses a compiled language
48+
49+
#- run: |
50+
# make bootstrap
51+
# make release
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@v1

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
2424
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
2525
sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
26-
npm install
26+
npm ci
2727
gulp LKG
2828
npm test
2929
git diff
@@ -32,7 +32,7 @@ jobs:
3232
git add tests/baselines/reference/api/typescript.d.ts
3333
git add tests/baselines/reference/api/tsserverlibrary.d.ts
3434
git add ./lib
35-
git config user.email "ts_bot@rcavanaugh.com"
35+
git config user.email "typescriptbot@microsoft.com"
3636
git config user.name "TypeScript Bot"
3737
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
3838
git push --set-upstream origin ${{ github.event.client_payload.branch_name }}

.github/workflows/nightly.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: Publish Nightly
33
on:
44
schedule:
55
- cron: '0 7 * * *'
6+
# enable users to manually trigger with workflow_dispatch
7+
workflow_dispatch: {}
68
repository_dispatch:
79
types: publish-nightly
810

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121
npm uninstall tslint --no-save
2222
- name: npm install and test
2323
run: |
24-
npm install
25-
npm update
24+
npm ci
2625
npm test
2726
env:
2827
CI: true
@@ -41,4 +40,3 @@ jobs:
4140
with:
4241
name: tgz
4342
path: typescript.tgz
44-

.github/workflows/set-version.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
3030
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
3131
sed -i -e 's/const version = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
32-
npm install
32+
npm ci
3333
gulp LKG
3434
npm test
3535
git diff
@@ -38,7 +38,7 @@ jobs:
3838
git add tests/baselines/reference/api/typescript.d.ts
3939
git add tests/baselines/reference/api/tsserverlibrary.d.ts
4040
git add ./lib
41-
git config user.email "ts_bot@rcavanaugh.com"
41+
git config user.email "typescriptbot@microsoft.com"
4242
git config user.name "TypeScript Bot"
4343
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
4444
git push

.github/workflows/sync-branch.yaml

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Sync branch with master
33
on:
44
repository_dispatch:
55
types: sync-branch
6+
workflow_dispatch:
7+
inputs:
8+
branch_name:
9+
description: 'Target Branch Name'
10+
required: true
611

712
jobs:
813
build:
@@ -15,15 +20,15 @@ jobs:
1520
node-version: 12.x
1621
- uses: actions/checkout@v2
1722
with:
18-
ref: ${{ github.event.client_payload.branch_name }}
23+
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
1924
# This does a test post-merge and only pushes the result if the test succeeds
2025
# required client_payload members:
2126
# branch_name - the target branch
2227
- run: |
23-
git config user.email "ts_bot@rcavanaugh.com"
28+
git config user.email "typescriptbot@microsoft.com"
2429
git config user.name "TypeScript Bot"
2530
git fetch origin master
26-
git merge master --no-ff
27-
npm install
31+
git merge origin/master --no-ff
32+
npm ci
2833
npm test
2934
git push
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Twoslash Code Sample Repros
2+
3+
on:
4+
push:
5+
branches:
6+
- orta-twoslash-repros
7+
schedule:
8+
- cron: '0 8 * * *'
9+
repository_dispatch:
10+
types: run-twoslash-repros
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Use node
17+
uses: actions/setup-node@v1
18+
- run: |
19+
npm init -y
20+
npm install --save typescript@next
21+
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
22+
with:
23+
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}

.github/workflows/update-lkg.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update LKG
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use node version 12
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 12
16+
registry-url: https://registry.npmjs.org/
17+
18+
- name: Configure Git and Update LKG
19+
run: |
20+
git config user.email "[email protected]"
21+
git config user.name "TypeScript Bot"
22+
npm ci
23+
gulp LKG
24+
npm test
25+
git diff
26+
git add ./lib
27+
git commit -m "Update LKG"
28+
git push
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update package-lock.json
2+
3+
on:
4+
schedule:
5+
# This is probably 6am UTC, which is 10pm PST or 11pm PDT
6+
# Alternatively, 6am local is also fine
7+
- cron: '0 6 * * *'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 12
18+
registry-url: https://registry.npmjs.org/
19+
20+
- name: Configure git and update package-lock.json
21+
run: |
22+
git config user.email "[email protected]"
23+
git config user.name "TypeScript Bot"
24+
npm install --package-lock-only
25+
git add -f package-lock.json
26+
if git commit -m "Update package-lock.json"; then
27+
git push
28+
fi

.npmrc

-1
This file was deleted.

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ language: node_js
22

33
node_js:
44
- 'node'
5+
- '12'
56
- '10'
6-
- '8'
77

88
env:
99
- workerCount=3 timeout=600000
@@ -18,7 +18,7 @@ branches:
1818

1919
install:
2020
- npm uninstall typescript --no-save
21-
- npm install
21+
- npm ci
2222

2323
cache:
2424
directories:

.vscode/launch.template.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,24 @@
4747
"console": "integratedTerminal",
4848
"outFiles": [
4949
"${workspaceRoot}/built/local/run.js"
50-
]
50+
],
51+
52+
// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
53+
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
54+
// this feature is shipping in insiders or to a release:
55+
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
5156
},
5257
{
5358
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
5459
"type": "node",
5560
"request": "attach",
5661
"name": "Attach to VS Code TS Server via Port",
57-
"processId": "${command:PickProcess}"
62+
"processId": "${command:PickProcess}",
63+
64+
// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
65+
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
66+
// this feature is shipping in insiders or to a release:
67+
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
5868
}
5969
]
6070
}

0 commit comments

Comments
 (0)