Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devDeps: @metamask/eslint-config*->12.1.0 #1523

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"@lavamoat/allow-scripts": "^2.3.1",
"@metamask/create-release-branch": "^1.1.0",
"@metamask/eslint-config": "^12.2.0",
"@metamask/eslint-config-jest": "^12.0.0",
"@metamask/eslint-config-nodejs": "^12.0.0",
"@metamask/eslint-config-typescript": "^12.0.0",
"@metamask/eslint-config-jest": "^12.1.0",
"@metamask/eslint-config-nodejs": "^12.1.0",
"@metamask/eslint-config-typescript": "^12.1.0",
"@metamask/eth-json-rpc-provider": "^1.0.0",
"@metamask/utils": "^6.2.0",
"@types/node": "^16.18.24",
Expand All @@ -63,7 +63,7 @@
"rimraf": "^3.0.2",
"simple-git-hooks": "^2.8.0",
"ts-node": "^10.9.1",
"typescript": "~4.6.3",
"typescript": "~4.8.4",
"which": "^3.0.0"
},
"packageManager": "yarn@3.3.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/accounts-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
"@types/readable-stream": "^2.3.0",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/keyring-controller": "^8.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/address-book-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/announcement-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"immer": "^9.0.6",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/approval-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/assets-controllers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/approval-controller": "^3.5.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/base-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/composable-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/controller-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"jest": "^27.5.1",
"nock": "^13.3.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/ens-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/network-controller": "^13.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/gas-fee-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/network-controller": "^13.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/keyring-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"jest": "^27.5.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4",
"uuid": "^8.3.2"
},
"peerDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/logging-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/message-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/name-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
8 changes: 6 additions & 2 deletions packages/name-controller/src/providers/etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
NameProviderResult,
} from '../types';
import { NameType } from '../types';
import { handleFetch } from '../util';
import { handleFetch, assertIsError } from '../util';

const ID = 'etherscan';
const LABEL = 'Etherscan (Verified Contract Name)';
Expand Down Expand Up @@ -134,7 +134,10 @@ export class EtherscanNameProvider implements NameProvider {
}
}

async #sendRequest(url: string) {
async #sendRequest(url: string): Promise<{
responseData?: EtherscanGetSourceCodeResponse;
error?: Error;
}> {
try {
log('Sending request', url);

Expand All @@ -144,6 +147,7 @@ export class EtherscanNameProvider implements NameProvider {

return { responseData };
} catch (error) {
assertIsError(error);
return { error };
} finally {
this.#lastRequestTime = Date.now();
Expand Down
16 changes: 16 additions & 0 deletions packages/name-controller/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,19 @@ export async function successfulFetch(request: string, options?: RequestInit) {
}
return response;
}

/**
* Assert that a value is an error. If it's not an error, throw an
* error that wraps the given value.
*
* TODO: Migrate this to @metamask/utils
*
* @param error - The value that we expect to be an error.
* @throws Throws an error wrapping the given value if it's not an error.
*/
export function assertIsError(error: unknown): asserts error is Error {
if (error instanceof Error) {
return;
}
throw new Error(`Invalid error of type '${typeof error}'`);
}
14 changes: 13 additions & 1 deletion packages/name-controller/src/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { graphQL } from './util';
import { assertIsError, graphQL } from './util';

describe('Utils', () => {
describe('graphQL', () => {
Expand Down Expand Up @@ -51,4 +51,16 @@ describe('Utils', () => {
);
});
});

describe('assertIsError', () => {
it('does not throw if given an error', () => {
expect(() => assertIsError(new Error('test'))).not.toThrow();
});

it('throws if passed something that is not an error', () => {
expect(() => assertIsError('test')).toThrow(
`Invalid error of type 'string'`,
);
});
});
});
6 changes: 3 additions & 3 deletions packages/network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/notification-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/permission-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/approval-controller": "^3.5.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/phishing-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/polling-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/network-controller": "^13.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/preferences-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/rate-limit-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"engines": {
"node": ">=16.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/selected-network-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"nock": "^13.3.1",
"sinon": "^9.2.4",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/network-controller": "^13.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/signature-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.23.15",
"typedoc-plugin-missing-exports": "^0.23.0",
"typescript": "~4.6.3"
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~4.8.4"
},
"peerDependencies": {
"@metamask/approval-controller": "^3.5.1",
Expand Down
Loading