Skip to content

Commit

Permalink
Upgrade: Bump typescript from 4.3.5 to 4.5.5
Browse files Browse the repository at this point in the history
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.5.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.3.5...v4.5.5)

- - - - - - - - - - - - - - - - - - - -

Close #4996

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christy Chen <[email protected]>
  • Loading branch information
dependabot[bot] and christyycchen committed Feb 18, 2022
1 parent addc5fc commit de1ef98
Show file tree
Hide file tree
Showing 132 changed files with 189 additions and 176 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"semver": "^7.3.5",
"shelljs": "^0.8.5",
"tsort": "^0.0.1",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"unzipper": "^0.10.11",
"yargs": "^17.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-jsdom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src"
Expand Down
5 changes: 3 additions & 2 deletions packages/connector-jsdom/src/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,11 @@ export default class JSDOMConnector implements IConnector {
try {
this._targetNetworkData = await this.fetchContent(target);
} catch (err) /* istanbul ignore next */ {
const hops: string[] = this.request.getRedirects(err.uri);
const e = err as any;
const hops: string[] = this.request.getRedirects(e.uri);
const fetchError: FetchError = {
element: null as any,
error: err.error ? err.error : err,
error: e.error ? e.error : e,
hops,
resource: href
};
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-jsdom/src/evaluate-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const run = async (data: { options: any; source: string }) => {

result.evaluate = evaluteResult;
} catch (err) {
result.error = err;
result.error = err as Error;
}

process.send!(result);
Expand Down
7 changes: 4 additions & 3 deletions packages/connector-jsdom/src/resource-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,14 @@ export default class CustomResourceLoader extends ResourceLoader {

return resolve(resourceNetworkData.response.body.rawContent);
} catch (err) {
const hops: string[] = this._connector.request.getRedirects(err.uri);
const error = err as any;
const hops: string[] = this._connector.request.getRedirects(error.uri);
const fetchError: FetchError = {
element: element!,
error: err.error,
error: error.error,
hops,
/* istanbul ignore next */
resource: err.uri || resourceUrl
resource: error.uri || resourceUrl
};

await this._connector.server.emitAsync('fetch::error', fetchError);
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src"
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-local/tests/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,6 @@ test('If target is a not a file, it should throw and exception', async (t) => {
try {
await connector.collect(new URL('https://example.com'));
} catch (err) {
t.is(err.message, 'Connector local only works with local files or directories');
t.is((err as Error).message, 'Connector local only works with local files or directories');
}
});
2 changes: 1 addition & 1 deletion packages/connector-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"puppeteer": "^10.4.0",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src"
Expand Down
2 changes: 1 addition & 1 deletion packages/connector-puppeteer/src/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const group = (actions: ActionConfig[] = []): UserActions => {
try {
loadedAction = require(pathToUserAction);
} catch (e) {
throw new Error(`Couldn't load user action in "${pathToUserAction}". ${e.message}`);
throw new Error(`Couldn't load user action in "${pathToUserAction}". ${(e as Error).message}`);
}

if (typeof loadedAction.action !== 'function') {
Expand Down
6 changes: 3 additions & 3 deletions packages/connector-puppeteer/tests/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test(`[${name}] Connector throws an exception if action is not found`, (t) => {

connector.close();
} catch (e) {
t.true((e.message as string).startsWith(`Couldn't load user action in "`));
t.true(((e as Error).message).startsWith(`Couldn't load user action in "`));
}
});

Expand Down Expand Up @@ -71,7 +71,7 @@ test(`[${name}] Connector loads an action and throws if it does not have the rig

connector.close();
} catch (e) {
t.is(e.message, `User action "${actionPath}" doesn't export a member "action".`);
t.is((e as Error).message, `User action "${actionPath}" doesn't export a member "action".`);
}
});

Expand Down Expand Up @@ -109,6 +109,6 @@ test(`[${name}] Connector loads an action and doesn't throw if it has the right

connector.close();
} catch (e) {
t.fail(e.message);
t.fail((e as Error).message);
}
});
2 changes: 1 addition & 1 deletion packages/create-hint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"ts-loader": "^9.2.6",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-hintrc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"ts-loader": "^9.2.6",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-hintrc/src/browserslist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const generateBrowserslistConfig = (): Promise<string[]> => {
return customQueries;
} catch (err) {
// The query format is invalid.
logger.log(`${err.message}.`);
logger.log(`${(err as Error).message}.`);
logger.log('Please try again.');

return askAndValidate();
Expand Down
2 changes: 1 addition & 1 deletion packages/create-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"ts-loader": "^9.2.6",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"svg-url-loader": "^7.1.1",
"terser-webpack-plugin": "^5.3.0",
"typed-css-modules": "^0.7.0",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"util": "^0.12.4",
"util.promisify": "^1.1.1",
"web-ext": "^6.6.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-browser/src/content-script/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class WebExtensionConnector implements IConnector {
}
// TODO: Trigger 'fetch::start::target'.
} catch (err) /* istanbul ignore next */ {
this._onComplete(err);
this._onComplete(err as Error);
}
});

Expand Down Expand Up @@ -114,7 +114,7 @@ export default class WebExtensionConnector implements IConnector {
this._onComplete(null, resource);

} catch (err) /* istanbul ignore next */ {
this._onComplete(err);
this._onComplete(err as Error);
}
}, this._options.waitFor);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const validate = (value?: string): string => {
* Report errors, stripping suffix about "old" browserslist since the user won't have control over that.
* E.g. "Unknown browser query `IE `. Maybe you are using old Browserslist or made typo in query."
*/
return e.message.replace(' Maybe you are using old Browserslist or made typo in query.', '');
return (e as Error).message.replace(' Maybe you are using old Browserslist or made typo in query.', '');
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const validate = (value?: string): string => {

return '';
} catch (e) {
return e.message;
return (e as Error).message;
}
};

Expand Down
4 changes: 2 additions & 2 deletions packages/extension-browser/tests/devtools.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import { launch } from 'puppeteer';
import * as puppeteer from 'puppeteer';
import test from 'ava';

import { Category } from '@hint/utils-types';
Expand Down Expand Up @@ -99,7 +99,7 @@ test('It builds a configuration, starts a scan, and displays results', async (t)
* Launch the browser and get a reference to the initial page.
* Note: Uncomment config options to see page content (aids debugging).
*/
const browser = await launch(/* { defaultViewport: null, headless: false } */);
const browser = await puppeteer.launch(/* { defaultViewport: null, headless: false } */);
const page = (await browser.pages())[0];

// Inject mock extension APIs, passing mock results to return to the devtools panel.
Expand Down
18 changes: 9 additions & 9 deletions packages/extension-browser/tests/end-to-end.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as isCI from 'is-ci';
import { launch, Browser, Frame, Page, Target } from 'puppeteer';
import * as puppeteer from 'puppeteer';
import test from 'ava';

import { delay } from '@hint/utils';
Expand All @@ -10,7 +10,7 @@ import { readFixture } from './helpers/fixtures';

const pathToExtension = `${__dirname}/../bundle`;

const getPageFromTarget = async (target: Target) => {
const getPageFromTarget = async (target: puppeteer.Target) => {
/*
* TODO: Replace this hack with something more stable.
* See https://github.com/GoogleChrome/puppeteer/issues/4247
Expand All @@ -32,7 +32,7 @@ const getPageFromTarget = async (target: Target) => {
* @param browser The Puppeteer `Browser` instance to search.
* @returns The found page for the background script.
*/
const findBackgroundScriptPage = async (browser: Browser): Promise<Page> => {
const findBackgroundScriptPage = async (browser: puppeteer.Browser): Promise<puppeteer.Page> => {
const targets = await browser.targets();
const bgTargets = targets.filter((t) => {
return t.type() === 'background_page';
Expand All @@ -53,7 +53,7 @@ const findBackgroundScriptPage = async (browser: Browser): Promise<Page> => {
return matches[i];
})[0];

return await bgTarget.page() as Page;
return await bgTarget.page() as puppeteer.Page;
};

/**
Expand All @@ -65,13 +65,13 @@ const findBackgroundScriptPage = async (browser: Browser): Promise<Page> => {
* @param browser The Puppeteer `Browser` instance to search.
* @returns The found devtools panel for the extension.
*/
const findWebhintDevtoolsPanel = async (browser: Browser): Promise<Frame> => {
const findWebhintDevtoolsPanel = async (browser: puppeteer.Browser): Promise<puppeteer.Frame> => {
const targets = await browser.targets();
const devtoolsTarget = targets.filter((t) => {
return t.type() === 'other' && t.url().startsWith('chrome-devtools://');
})[0];

const devtoolsPage = await getPageFromTarget(devtoolsTarget) as Page;
const devtoolsPage = await getPageFromTarget(devtoolsTarget) as puppeteer.Page;

await delay(500);

Expand All @@ -93,7 +93,7 @@ const findWebhintDevtoolsPanel = async (browser: Browser): Promise<Frame> => {
target.url().endsWith('/panel.html');
})[0];

const webhintPanelPage = await getPageFromTarget(webhintTarget) as Page;
const webhintPanelPage = await getPageFromTarget(webhintTarget) as puppeteer.Page;
const webhintPanelFrame = webhintPanelPage.frames()[0];

return webhintPanelFrame;
Expand All @@ -105,7 +105,7 @@ test('It runs end-to-end in a page', async (t) => {

const url = `http://localhost:${server.port}/`;

const browser = await launch();
const browser = await puppeteer.launch();
const page = (await browser.pages())[0];

await page.goto(url);
Expand Down Expand Up @@ -214,7 +214,7 @@ if (!isCI) {

const url = `http://localhost:${server.port}/`;

const browser = await launch({
const browser = await puppeteer.launch({
args: [
`--disable-extensions-except=${pathToExtension}`,
`--load-extension=${pathToExtension}`
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"ts-loader": "^9.2.6",
"typescript": "^4.3.5",
"typescript": "^4.5.5",
"vsce": "^1.100.2",
"vscode-languageclient": "^7.0.0",
"vscode-languageserver": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-codeframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-excel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-excel/src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class ExcelFormatter implements IFormatter {
{ // eslint-disable-line
logger.error(getMessage('errorSaving', language));

if (e.message.includes('EBUSY')) {
if ((e as Error).message.includes('EBUSY')) {
logger.error(getMessage('maybeIsOpened', language));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-stylish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter-summary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"proxyquire": "^2.1.3",
"rimraf": "^3.0.2",
"sinon": "^13.0.1",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
2 changes: 1 addition & 1 deletion packages/hint-amp-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src"
Expand Down
2 changes: 1 addition & 1 deletion packages/hint-apple-touch-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src"
Expand Down
2 changes: 1 addition & 1 deletion packages/hint-axe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
"typescript": "^4.5.5"
},
"files": [
"dist/src",
Expand Down
Loading

0 comments on commit de1ef98

Please sign in to comment.