Skip to content

Commit 409b427

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into feature/36048
2 parents 94dbe2f + 2cc5856 commit 409b427

File tree

645 files changed

+31757
-4544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

645 files changed

+31757
-4544
lines changed

.eslintrc.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"@typescript-eslint/no-inferrable-types": "error",
2727
"@typescript-eslint/no-misused-new": "error",
2828
"@typescript-eslint/no-this-alias": "error",
29+
30+
"no-unused-expressions": "off",
31+
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
32+
2933
"@typescript-eslint/prefer-for-of": "error",
3034
"@typescript-eslint/prefer-function-type": "error",
3135
"@typescript-eslint/prefer-namespace-keyword": "error",
@@ -36,6 +40,13 @@
3640
"semi": "off",
3741
"@typescript-eslint/semi": "error",
3842

43+
"space-before-function-paren": "off",
44+
"@typescript-eslint/space-before-function-paren": ["error", {
45+
"asyncArrow": "always",
46+
"anonymous": "always",
47+
"named": "never"
48+
}],
49+
3950
"@typescript-eslint/triple-slash-reference": "error",
4051
"@typescript-eslint/type-annotation-spacing": "error",
4152
"@typescript-eslint/unified-signatures": "error",
@@ -97,7 +108,6 @@
97108
"no-trailing-spaces": "error",
98109
"no-undef-init": "error",
99110
"no-unsafe-finally": "error",
100-
"no-unused-expressions": ["error", { "allowTernary": true }],
101111
"no-unused-labels": "error",
102112
"no-var": "error",
103113
"object-shorthand": "error",

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
---
12
blank_issues_enabled: false
2-
contact_links:
3-
- name: Question
4-
url: https://stackoverflow.com/questions/tagged/typescript
5-
about: Please ask and answer questions here.
6-
- name: TypeScript FAQ
7-
url: https://github.com/microsoft/TypeScript/wiki/FAQ
8-
about: Please check the FAQ before filing new issues
9-
- name: Website
10-
url: https://github.com/microsoft/TypeScript-Website/issues/new
11-
about: Please raise issues about the site on it's own repo.
3+
contact_links:
4+
-
5+
about: "Please ask and answer usage questions on Stack Overflow."
6+
name: Question
7+
url: "https://stackoverflow.com/questions/tagged/typescript"
8+
-
9+
about: "Alternatively, you can use the TypeScript Community Discord."
10+
name: Chat
11+
url: "https://discord.gg/typescript"
12+
-
13+
about: "Please check the FAQ before filing new issues"
14+
name: "TypeScript FAQ"
15+
url: "https://github.com/microsoft/TypeScript/wiki/FAQ"
16+
-
17+
about: "Please raise issues about the site on it's own repo."
18+
name: Website
19+
url: "https://github.com/microsoft/TypeScript-Website/issues/new"

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
3-
"dbaeumer.vscode-eslint"
3+
"dbaeumer.vscode-eslint",
4+
"rbuckton.tsserver-live-reload"
45
],
56

67
"unwantedRecommendations": [

Gulpfile.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,6 @@ const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lin
346346

347347
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
348348
const eslint = (folder) => async () => {
349-
const ESLINTRC_CI = ".eslintrc.ci.json";
350-
const isCIEnv = cmdLineOptions.ci || process.env.CI === "true";
351349

352350
const args = [
353351
"node_modules/eslint/bin/eslint",
@@ -358,13 +356,6 @@ const eslint = (folder) => async () => {
358356
"--ext", ".ts",
359357
];
360358

361-
if (
362-
isCIEnv &&
363-
fs.existsSync(path.resolve(folder, ESLINTRC_CI))
364-
) {
365-
args.push("--config", path.resolve(folder, ESLINTRC_CI));
366-
}
367-
368359
if (cmdLineOptions.fix) {
369360
args.push("--fix");
370361
}

lib/lib.es2015.symbol.wellknown.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*! *****************************************************************************
2-
Copyright (c) Microsoft Corporation. All rights reserved.
2+
Copyright (c) Microsoft Corporation. All rights reserved.
33
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
44
this file except in compliance with the License. You may obtain a copy of the
5-
License at http://www.apache.org/licenses/LICENSE-2.0
6-
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
77
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
88
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10-
MERCHANTABLITY OR NON-INFRINGEMENT.
11-
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
1212
See the Apache Version 2.0 License for specific language governing permissions
1313
and limitations under the License.
1414
***************************************************************************** */
@@ -91,7 +91,7 @@ interface Array<T> {
9191
* Returns an object whose properties have the value 'true'
9292
* when they will be absent when used in a 'with' statement.
9393
*/
94-
[Symbol.unscopables](): {
94+
[Symbol.unscopables]: {
9595
copyWithin: boolean;
9696
entries: boolean;
9797
fill: boolean;

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
"@types/through2": "latest",
5555
"@types/travis-fold": "latest",
5656
"@types/xml2js": "^0.4.0",
57-
"@typescript-eslint/eslint-plugin": "2.3.2",
58-
"@typescript-eslint/experimental-utils": "2.3.2",
59-
"@typescript-eslint/parser": "2.3.2",
57+
"@typescript-eslint/eslint-plugin": "2.18.0",
58+
"@typescript-eslint/experimental-utils": "2.18.0",
59+
"@typescript-eslint/parser": "2.18.0",
6060
"async": "latest",
6161
"azure-devops-node-api": "^8.0.0",
6262
"browser-resolve": "^1.11.2",
@@ -65,10 +65,10 @@
6565
"chalk": "latest",
6666
"convert-source-map": "latest",
6767
"del": "5.1.0",
68-
"eslint": "6.5.1",
69-
"eslint-formatter-autolinkable-stylish": "1.0.3",
70-
"eslint-plugin-import": "2.18.2",
71-
"eslint-plugin-jsdoc": "15.9.9",
68+
"eslint": "6.8.0",
69+
"eslint-formatter-autolinkable-stylish": "1.1.1",
70+
"eslint-plugin-import": "2.20.0",
71+
"eslint-plugin-jsdoc": "21.0.0",
7272
"eslint-plugin-no-null": "1.0.2",
7373
"fancy-log": "latest",
7474
"fs-extra": "^6.0.1",

scripts/configurePrerelease.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function updateTsFile(tsFilePath: string, tsFileContents: string, majorMinor: st
6060
const parsedMajorMinor = majorMinorMatch![1];
6161
assert(parsedMajorMinor === majorMinor, `versionMajorMinor does not match. ${tsFilePath}: '${parsedMajorMinor}'; package.json: '${majorMinor}'`);
6262

63-
const versionRgx = /export const version = `\$\{versionMajorMinor\}\.(\d)(-dev)?`;/;
63+
const versionRgx = /export const version = `\$\{versionMajorMinor\}\.(\d)(-\w+)?`;/;
6464
const patchMatch = versionRgx.exec(tsFileContents);
6565
assert(patchMatch !== null, `The file '${tsFilePath}' seems to no longer have a string matching '${versionRgx.toString()}'.`);
6666
const parsedPatch = patchMatch![1];

scripts/eslint/rules/one-namespace-per-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export = createRule({
1010
recommended: "error",
1111
},
1212
messages: {
13-
excessNamespaceError: `All but one of these namespaces should be moved into seperate files.`,
13+
excessNamespaceError: `All but one of these namespaces should be moved into separate files.`,
1414
},
1515
schema: [],
1616
type: "problem",

scripts/open-cherry-pick-pr.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
33
/// <reference types="node" />
44

5-
import Octokit = require("@octokit/rest");
5+
import { Octokit } from "@octokit/rest";
66
const {runSequence} = require("./run-sequence");
77
import fs = require("fs");
88
import path = require("path");
@@ -26,18 +26,34 @@ async function main() {
2626
const currentAuthor = runSequence([
2727
["git", ["log", "-1", `--pretty="%aN <%aE>"`]]
2828
]);
29+
30+
const gh = new Octokit();
31+
gh.authenticate({
32+
type: "token",
33+
token: process.argv[2]
34+
});
35+
36+
const inputPR = (await gh.pulls.get({ pull_number: +process.env.SOURCE_ISSUE, owner: "microsoft", repo: "TypeScript" })).data;
37+
let remoteName = "origin";
38+
if (inputPR.base.repo.git_url !== `git:github.com/microsoft/TypeScript`) {
39+
runSequence([
40+
["git", ["remote", "add", "nonlocal", inputPR.base.repo.git_url]]
41+
]);
42+
remoteName = "nonlocal";
43+
}
44+
const baseBranchName = inputPR.base.ref;
2945
runSequence([
30-
["git", ["fetch", "origin", "master"]]
46+
["git", ["fetch", remoteName, baseBranchName]]
3147
]);
3248
let logText = runSequence([
33-
["git", ["log", `origin/master..${currentSha.trim()}`, `--pretty="%h %s%n%b"`, "--reverse"]]
49+
["git", ["log", `${remoteName}/${baseBranchName}..${currentSha.trim()}`, `--pretty="%h %s%n%b"`, "--reverse"]]
3450
]);
3551
logText = `Cherry-pick PR #${process.env.SOURCE_ISSUE} into ${process.env.TARGET_BRANCH}
3652
3753
Component commits:
3854
${logText.trim()}`;
3955
const logpath = path.join(__dirname, "../", "logmessage.txt");
40-
const mergebase = runSequence([["git", ["merge-base", "origin/master", currentSha]]]).trim();
56+
const mergebase = runSequence([["git", ["merge-base", `${remoteName}/${baseBranchName}`, currentSha]]]).trim();
4157
runSequence([
4258
["git", ["checkout", "-b", "temp-branch"]],
4359
["git", ["reset", mergebase, "--soft"]]
@@ -67,11 +83,6 @@ ${logText.trim()}`;
6783
["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch
6884
]);
6985

70-
const gh = new Octokit();
71-
gh.authenticate({
72-
type: "token",
73-
token: process.argv[2]
74-
});
7586
const r = await gh.pulls.create({
7687
owner: "Microsoft",
7788
repo: "TypeScript",

src/.eslintrc.ci.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"extends": "../.eslintrc.json",
3+
"parserOptions": {
4+
"tsconfigRootDir": "src",
5+
"project": "./tsconfig-base.json"
6+
},
7+
"rules": {
8+
"@typescript-eslint/no-unnecessary-qualifier": "error",
9+
"@typescript-eslint/no-unnecessary-type-assertion": "error"
10+
},
311
"overrides": [
412
{
513
"files": ["lib/*.d.ts"],

0 commit comments

Comments
 (0)