From ecc8ae3cd2df89d14534e9fd78bbdeff86e69127 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Thu, 27 Sep 2018 12:04:14 -0700 Subject: [PATCH] deps: update to tsc 3.1.1 --- .../gather/computed/metrics/lantern-interactive.js | 1 - lighthouse-core/lib/file-namer.js | 2 +- lighthouse-core/lib/i18n/locales.js | 1 - lighthouse-core/report/report-generator.js | 5 ++--- lighthouse-core/scripts/update-report-fixtures.js | 6 ++---- lighthouse-viewer/app/src/firebase-auth.js | 2 +- lighthouse-viewer/app/src/github-api.js | 2 +- lighthouse-viewer/app/src/lighthouse-report-viewer.js | 2 +- lighthouse-viewer/app/src/viewer-ui-features.js | 2 +- package.json | 2 +- typings/externs.d.ts | 2 +- yarn.lock | 6 +++--- 12 files changed, 14 insertions(+), 19 deletions(-) diff --git a/lighthouse-core/gather/computed/metrics/lantern-interactive.js b/lighthouse-core/gather/computed/metrics/lantern-interactive.js index b4789611d554..0b2241875245 100644 --- a/lighthouse-core/gather/computed/metrics/lantern-interactive.js +++ b/lighthouse-core/gather/computed/metrics/lantern-interactive.js @@ -97,7 +97,6 @@ class Interactive extends MetricArtifact { * @return {number} */ static getLastLongTaskEndTime(nodeTimings, duration = 50) { - // @ts-ignore TS can't infer how the object invariants change return Array.from(nodeTimings.entries()) .filter(([node, timing]) => { if (node.type !== BaseNode.TYPES.CPU) return false; diff --git a/lighthouse-core/lib/file-namer.js b/lighthouse-core/lib/file-namer.js index 67ff7844817d..6ed093a10bb9 100644 --- a/lighthouse-core/lib/file-namer.js +++ b/lighthouse-core/lib/file-namer.js @@ -44,7 +44,7 @@ function getUrlConstructor() { } } -// @ts-ignore - suppress `module` error for type-checking in a browser context. +// don't attempt to export in the browser. if (typeof module !== 'undefined' && module.exports) { module.exports = {getFilenamePrefix}; } diff --git a/lighthouse-core/lib/i18n/locales.js b/lighthouse-core/lib/i18n/locales.js index 0ee75974ac18..273f778b72e6 100644 --- a/lighthouse-core/lib/i18n/locales.js +++ b/lighthouse-core/lib/i18n/locales.js @@ -18,7 +18,6 @@ /** @type {Record} */ const locales = { 'en-US': require('./en-US.json'), // The 'source' strings, with descriptions - // @ts-ignore - tsc bug, something about en/en-US pointing to same file. https://github.com/Microsoft/TypeScript/issues/26307 'en': require('./en-US.json'), // According to CLDR/ICU, 'en' == 'en-US' dates/numbers (Why?!) // TODO: en-GB has just ~10 messages that are different from en-US. We should only ship those. diff --git a/lighthouse-core/report/report-generator.js b/lighthouse-core/report/report-generator.js index 384bc36b368c..09d653a30106 100644 --- a/lighthouse-core/report/report-generator.js +++ b/lighthouse-core/report/report-generator.js @@ -80,9 +80,8 @@ class ReportGenerator { }); }); - // @ts-ignore TS loses track of type Array - const flattedTable = [].concat(...table); - return [header, ...flattedTable].map(row => row.join(separator)).join(CRLF); + return [header].concat(...table) + .map(row => row.join(separator)).join(CRLF); } /** diff --git a/lighthouse-core/scripts/update-report-fixtures.js b/lighthouse-core/scripts/update-report-fixtures.js index c24874bd7747..ec1ed590e770 100644 --- a/lighthouse-core/scripts/update-report-fixtures.js +++ b/lighthouse-core/scripts/update-report-fixtures.js @@ -6,6 +6,7 @@ 'use strict'; const cli = require('../../lighthouse-cli/run'); +const cliFlags = require('../../lighthouse-cli/cli-flags.js'); const {server} = require('../../lighthouse-cli/test/fixtures/static-server'); @@ -18,10 +19,7 @@ async function update() { const port = await new Promise(res => server.on('listening', () => res(server.address().port))); const url = `http://localhost:${port}/dobetterweb/dbw_tester.html`; - const flags = { - gatherMode: 'lighthouse-core/test/results/artifacts', - }; - // @ts-ignore Remove when we fix Flags typing + const flags = cliFlags.getFlags(`--gather-mode=lighthouse-core/test/results/artifacts ${url}`); await cli.runLighthouse(url, flags, undefined); await new Promise(res => server.close(res)); } diff --git a/lighthouse-viewer/app/src/firebase-auth.js b/lighthouse-viewer/app/src/firebase-auth.js index 91c7f422f810..894efc1ba606 100644 --- a/lighthouse-viewer/app/src/firebase-auth.js +++ b/lighthouse-viewer/app/src/firebase-auth.js @@ -91,7 +91,7 @@ class FirebaseAuth { } } -// @ts-ignore - node export for testing. +// node export for testing. if (typeof module !== 'undefined' && module.exports) { module.exports = FirebaseAuth; } diff --git a/lighthouse-viewer/app/src/github-api.js b/lighthouse-viewer/app/src/github-api.js index 4f137f35a96e..ee6f4bec47ef 100644 --- a/lighthouse-viewer/app/src/github-api.js +++ b/lighthouse-viewer/app/src/github-api.js @@ -150,7 +150,7 @@ class GithubApi { } } -// @ts-ignore - node export for testing. +// node export for testing. if (typeof module !== 'undefined' && module.exports) { module.exports = GithubApi; } diff --git a/lighthouse-viewer/app/src/lighthouse-report-viewer.js b/lighthouse-viewer/app/src/lighthouse-report-viewer.js index 28847ac6a096..b56558315da8 100644 --- a/lighthouse-viewer/app/src/lighthouse-report-viewer.js +++ b/lighthouse-viewer/app/src/lighthouse-report-viewer.js @@ -368,7 +368,7 @@ class LighthouseReportViewer { } } -// @ts-ignore - node export for testing. +// node export for testing. if (typeof module !== 'undefined' && module.exports) { module.exports = LighthouseReportViewer; } diff --git a/lighthouse-viewer/app/src/viewer-ui-features.js b/lighthouse-viewer/app/src/viewer-ui-features.js index 0a4a6bd0652b..984f550a522c 100644 --- a/lighthouse-viewer/app/src/viewer-ui-features.js +++ b/lighthouse-viewer/app/src/viewer-ui-features.js @@ -62,7 +62,7 @@ class ViewerUIFeatures extends ReportUIFeatures { } } -// @ts-ignore - node export for testing. +// node export for testing. if (typeof module !== 'undefined' && module.exports) { module.exports = ViewerUIFeatures; } diff --git a/package.json b/package.json index 81919aadf894..0d28092b964c 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "pretty-json-stringify": "^0.0.2", "puppeteer": "1.4.0", "sinon": "^2.3.5", - "typescript": "3.1.0-dev.20180831", + "typescript": "3.1.1", "zone.js": "^0.7.3" }, "dependencies": { diff --git a/typings/externs.d.ts b/typings/externs.d.ts index 9c322d7b9c00..a8796d863230 100644 --- a/typings/externs.d.ts +++ b/typings/externs.d.ts @@ -69,7 +69,7 @@ declare global { cpuSlowdownMultiplier?: number } - export type Locale = 'en-US'|'en'|'en-AU'|'en-GB'|'en-IE'|'en-SG'|'en-ZA'|'en-IN'|'ar-XB'|'ar'|'bg'|'bs'|'ca'|'cs'|'da'|'de'|'el'|'en-XA'|'es'|'fi'|'fil'|'fr'|'he'|'hi'|'hr'|'hu'|'gsw'|'id'|'in'|'it'|'iw'|'ja'|'ko'|'lt'|'lv'|'mo'|'nl'|'nb'|'no'|'pl'|'pt'|'pt-PT'|'ro'|'ru'|'sk'|'sl'|'sr'|'sr-Latn'|'sv'|'ta'|'te'|'th'|'tl'|'tr'|'uk'|'vi'|'zh'|'zh-HK'|'zh-TW'; + export type Locale = 'en-US'|'en'|'en-AU'|'en-GB'|'en-IE'|'en-SG'|'en-ZA'|'en-IN'|'ar-XB'|'ar'|'bg'|'bs'|'ca'|'cs'|'da'|'de'|'el'|'en-XA'|'es'|'fi'|'fil'|'fr'|'he'|'hi'|'hr'|'hu'|'gsw'|'id'|'in'|'it'|'iw'|'ja'|'ko'|'ln'|'lt'|'lv'|'mo'|'nl'|'nb'|'no'|'pl'|'pt'|'pt-PT'|'ro'|'ru'|'sk'|'sl'|'sr'|'sr-Latn'|'sv'|'ta'|'te'|'th'|'tl'|'tr'|'uk'|'vi'|'zh'|'zh-HK'|'zh-TW'; export type OutputMode = 'json' | 'html' | 'csv'; diff --git a/yarn.lock b/yarn.lock index fe27682879a4..16a45e4053f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6208,9 +6208,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@3.1.0-dev.20180831: - version "3.1.0-dev.20180831" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.0-dev.20180831.tgz#d1c0c715f17368417cad96bda042cf26d56f3d61" +typescript@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.1.tgz#3362ba9dd1e482ebb2355b02dfe8bcd19a2c7c96" uglify-js@^2.6: version "2.7.3"