Skip to content

Commit 34fb1d2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: LEGO: check in for master to temporary branch. Preserve newlines between try/catch/finally, if/else, do/while (microsoft#39280) not narrow static property without type annotation in constructor. (microsoft#39252) Switch to ES Map/Set internally (microsoft#33771) fix(38840): omit completions for a spread like argument in a function definition (microsoft#38897) fix(38785): include in NavigationBar child items from default exported functions (microsoft#38915) LEGO: check in for master to temporary branch. LEGO: check in for master to temporary branch. Avoid effect of element access expression (microsoft#39174) Update typescript-eslint to 3.4.1-alpha.1 (microsoft#39260) Handle 'keyof' for generic tuple types (microsoft#39218) Disable unsound T[K] rule in subtype relations (microsoft#39249) LEGO: check in for master to temporary branch. Upgrade typescript-eslint version (microsoft#39242) Handle recursive type references up to a certain level of expansion in inference (microsoft#38011) Do not consider binding patterns in contextual types for return type inference where all the signature type parameters have defaults (microsoft#39081) LEGO: check in for master to temporary branch. # Conflicts: # src/compiler/program.ts # src/compiler/types.ts
2 parents 0a03943 + 1aaa2ec commit 34fb1d2

File tree

190 files changed

+6427
-2108
lines changed

Some content is hidden

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

190 files changed

+6427
-2108
lines changed

.eslintrc.json

Lines changed: 12 additions & 3 deletions
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",

package.json

Lines changed: 4 additions & 4 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.27.0",
58-
"@typescript-eslint/experimental-utils": "2.27.0",
59-
"@typescript-eslint/parser": "2.27.0",
57+
"@typescript-eslint/eslint-plugin": "^3.4.1-alpha.1",
58+
"@typescript-eslint/experimental-utils": "^3.4.1-alpha.1",
59+
"@typescript-eslint/parser": "^3.4.1-alpha.1",
6060
"async": "latest",
6161
"azure-devops-node-api": "^10.1.0",
6262
"browser-resolve": "^1.11.2",
@@ -97,7 +97,7 @@
9797
"source-map-support": "latest",
9898
"through2": "latest",
9999
"travis-fold": "latest",
100-
"typescript": "^3.9.3",
100+
"typescript": "^4.0.0-dev.20200624",
101101
"vinyl": "latest",
102102
"vinyl-sourcemaps-apply": "latest",
103103
"xml2js": "^0.4.19"

src/compiler/binder.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace ts {
1515
referenced: boolean;
1616
}
1717

18-
export function getModuleInstanceState(node: ModuleDeclaration, visited?: Map<ModuleInstanceState | undefined>): ModuleInstanceState {
18+
export function getModuleInstanceState(node: ModuleDeclaration, visited?: Map<number, ModuleInstanceState | undefined>): ModuleInstanceState {
1919
if (node.body && !node.body.parent) {
2020
// getModuleInstanceStateForAliasTarget needs to walk up the parent chain, so parent pointers must be set on this tree already
2121
setParent(node.body, node);
@@ -24,8 +24,8 @@ namespace ts {
2424
return node.body ? getModuleInstanceStateCached(node.body, visited) : ModuleInstanceState.Instantiated;
2525
}
2626

27-
function getModuleInstanceStateCached(node: Node, visited = createMap<ModuleInstanceState | undefined>()) {
28-
const nodeId = "" + getNodeId(node);
27+
function getModuleInstanceStateCached(node: Node, visited = new Map<number, ModuleInstanceState | undefined>()) {
28+
const nodeId = getNodeId(node);
2929
if (visited.has(nodeId)) {
3030
return visited.get(nodeId) || ModuleInstanceState.NonInstantiated;
3131
}
@@ -35,7 +35,7 @@ namespace ts {
3535
return result;
3636
}
3737

38-
function getModuleInstanceStateWorker(node: Node, visited: Map<ModuleInstanceState | undefined>): ModuleInstanceState {
38+
function getModuleInstanceStateWorker(node: Node, visited: Map<number, ModuleInstanceState | undefined>): ModuleInstanceState {
3939
// A module is uninstantiated if it contains only
4040
switch (node.kind) {
4141
// 1. interface declarations, type alias declarations
@@ -107,7 +107,7 @@ namespace ts {
107107
return ModuleInstanceState.Instantiated;
108108
}
109109

110-
function getModuleInstanceStateForAliasTarget(specifier: ExportSpecifier, visited: Map<ModuleInstanceState | undefined>) {
110+
function getModuleInstanceStateForAliasTarget(specifier: ExportSpecifier, visited: Map<number, ModuleInstanceState | undefined>) {
111111
const name = specifier.propertyName || specifier.name;
112112
let p: Node | undefined = specifier.parent;
113113
while (p) {
@@ -2916,8 +2916,7 @@ namespace ts {
29162916

29172917
function addLateBoundAssignmentDeclarationToSymbol(node: BinaryExpression | DynamicNamedDeclaration, symbol: Symbol | undefined) {
29182918
if (symbol) {
2919-
const members = symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = createMap());
2920-
members.set("" + getNodeId(node), node);
2919+
(symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = new Map())).set(getNodeId(node), node);
29212920
}
29222921
}
29232922

0 commit comments

Comments
 (0)