Skip to content

🤖 User test baselines have changed#26088

Merged
sandersn merged 1 commit into
microsoft:masterfrom
typescript-bot:user-update-20180602
Jul 31, 2018
Merged

🤖 User test baselines have changed#26088
sandersn merged 1 commit into
microsoft:masterfrom
typescript-bot:user-update-20180602

Conversation

@typescript-bot
Copy link
Copy Markdown
Collaborator

Please review the diff and merge if no changes are unexpected.
You can view the build log here.

cc @weswigham @sandersn @mhegazy

Copy link
Copy Markdown
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With @enum, chrome-devtools-frontend gets rid of over 600 lines of errors.

@@ -1,55 +1,55 @@
Exit Code: 1
Standard output:
node_modules/uglify-js/lib/ast.js(209,23): error TS2554: Expected 0 arguments, but got 1.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No real changes here, just some added lines.

lib/Page.js(394,22): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(407,15): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(731,19): error TS2503: Cannot find namespace 'Protocol'.
lib/Page.js(928,3): error TS2322: Type '{ [x: string]: any; width: number; height: number; }' is not assignable to type 'string'.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad use of @enum:

/** @enum {string} */
Page.PaperFormats = {
  letter: { width: 8.5, height: 11 },
  legal: { width: 8.5, height: 14 }
}

Should be @enum {{width: number, heigh: number}}

Exit Code: 1
Standard output:
index.js(3,25): error TS2307: Cannot find module './package.json'.
index.js(3,25): error TS2732: Cannot find module './package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New, better error message.

node_modules/lodash/_baseUniq.js(62,15): error TS2554: Expected 2 arguments, but got 3.
node_modules/lodash/_cloneArrayBuffer.js(11,16): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
node_modules/lodash/_cloneBuffer.js(4,69): error TS2339: Property 'nodeType' does not exist on type '{}'.
node_modules/lodash/_cloneBuffer.js(7,80): error TS2339: Property 'nodeType' does not exist on type 'NodeModule'.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're resolving to the new module.exports symbol instead of NodeModule in @types/node.

@@ -29,9 +29,7 @@ node_modules/chrome-devtools-frontend/front_end/Runtime.js(270,9): error TS2322:
Type 'void' is not assignable to type 'undefined'.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(280,5): error TS2322: Type 'Promise<void>' is not assignable to type 'Promise<undefined>'.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(283,7): error TS2554: Expected 2-3 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(398,24): error TS1138: Parameter declaration expected.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result of better function() type parsing

node_modules/chrome-devtools-frontend/front_end/Runtime.js(398,24): error TS1138: Parameter declaration expected.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(398,24): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(527,49): error TS2352: Type 'Window' cannot be converted to type 'Function'.
node_modules/chrome-devtools-frontend/front_end/Runtime.js(527,49): error TS2352: Conversion of type 'Window' to type 'Function' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More detailed error on type assertion.

@@ -261,8 +259,6 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(189,
node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(194,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(198,26): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(202,25): error TS2694: Namespace 'Protocol' has no exported member 'Animation'.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(290,51): error TS2694: Namespace 'Animation.AnimationModel.Animation' has no exported member 'Type'.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type is an @enum, which is now recognised.

@@ -347,7 +343,6 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1
node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(208,50): error TS2554: Expected 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(208,67): error TS2554: Expected 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(216,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'.
node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(218,34): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ [x: string]: any; WindowDocked: number; WindowUndocked: number; ScriptsBreakpointSet: number; TimelineStarted: number; ProfilesCPUProfileTaken: number; ProfilesHeapProfileTaken: number; AuditsStarted: number; ... 23 more ...; ShowedThirdPartyBadges: number; }'.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Host.UserMetrics.Action is now recognised as an @enum {number}, which allows numbers to be assigned to it.

@@ -3045,8 +3035,6 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(70848,34): error TS2304: Cannot find name 'fs'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'.
node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(22,20): error TS1099: Type argument list cannot be empty.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better function() type parsing.

node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(48,52): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ [x: string]: any; Debugger: string; Formatter: string; Network: string; Snippets: string; FileSystem: string; ContentScripts: string; Service: string; }'.
node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(50,62): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ [x: string]: any; Debugger: string; Formatter: string; Network: string; Snippets: string; FileSystem: string; ContentScripts: string; Service: string; }'.
node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(59,56): error TS2345: Argument of type 'string' is not assignable to parameter of type '{ [x: string]: any; Debugger: string; Formatter: string; Network: string; Snippets: string; FileSystem: string; ContentScripts: string; Service: string; }'.
node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(52,49): error TS2345: Argument of type 'ContentProviderBasedProject' is not assignable to parameter of type '{ [x: string]: any; workspace(): Workspace; id(): string; type(): string; isServiceProject(): boolean; displayName(): string; requestMetadata(uiSourceCode: UISourceCode): Promise<UISourceCodeMetadata>; ... 17 more ...; uiSourceCodes(): UISourceCode[]; }'.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better errors because @enum is understoood. I think they are still wrong because ContentProviderBasedProject has @implements Project, which is the type that we are giving an assignability error for.

@sandersn sandersn merged commit 6cd313b into microsoft:master Jul 31, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants