Skip to content

Commit 88f7913

Browse files
committed
Pin eslint-plugin-import to 2.26.0 as workaround for regression
import-js/eslint-plugin-import#2775
1 parent a15882b commit 88f7913

File tree

27 files changed

+60
-52
lines changed

27 files changed

+60
-52
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@types/glob@^7.1.1": "patch:@types/glob@npm%3A7.1.4#./.yarn/patches/@types-glob-npm-7.1.4-d45247eaa2.patch",
5454
"@types/mocha@^10.0.1": "patch:@types/mocha@npm:10.0.1#.yarn/patches/@types-mocha-npm-10.0.1-7c94e9e170.patch",
5555
"clet@^1.0.1": "patch:clet@npm%3A1.0.1#./.yarn/patches/clet-npm-1.0.1-8523231bdc.patch",
56+
"eslint-plugin-import": "2.26.0",
5657
"find-babel-config": "^2.0.0",
5758
"inline-source-map@~0.6.0": "patch:inline-source-map@npm%3A0.6.2#./.yarn/patches/inline-source-map-npm-0.6.2-96902459a0.patch",
5859
"jest-fetch-mock@^3.0.3": "patch:jest-fetch-mock@npm:3.0.3#.yarn/patches/jest-fetch-mock-npm-3.0.3-ac072ca8af.patch",

packages/snaps-cli/src/cmds/watch/watchHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function watch(argv: YargsArgs): Promise<void> {
9191

9292
.on('ready', () => {
9393
buildSnap()
94-
.then(() => {
94+
.then(async () => {
9595
if (shouldServe) {
9696
return serve(argv);
9797
}

packages/snaps-controllers/src/snaps/SnapController.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,7 +1772,7 @@ describe('SnapController', () => {
17721772
// we need an rpc message handler function to be returned
17731773
jest
17741774
.spyOn(messenger, 'call')
1775-
.mockImplementation((method, ..._args: unknown[]) => {
1775+
.mockImplementation(async (method, ..._args: unknown[]) => {
17761776
if (method === 'ExecutionService:executeSnap') {
17771777
return deferredExecutePromise;
17781778
} else if (method === 'ExecutionService:handleRpcRequest') {

packages/snaps-execution-environments/src/common/endowments/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function createEndowments(
113113

114114
const teardown = async () => {
115115
await Promise.all(
116-
result.teardowns.map((teardownFunction) => teardownFunction()),
116+
result.teardowns.map(async (teardownFunction) => teardownFunction()),
117117
);
118118
};
119119
return { endowments: result.allEndowments, teardown };

packages/snaps-jest/src/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export async function installSnap(
7070
});
7171

7272
return {
73-
request: (options) => {
73+
request: async (options) => {
7474
log('Sending request %o.', options);
7575

7676
// Note: This function is intentionally not async, so that we can access
@@ -84,7 +84,7 @@ export async function installSnap(
8484
return await sendTransaction(page, options);
8585
},
8686

87-
runCronjob: (options) => {
87+
runCronjob: async (options) => {
8888
log('Running cronjob %o.', options);
8989

9090
// Note: This function is intentionally not async, so that we can access

packages/snaps-jest/src/internals/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function sendRequest(page: Page, args: SnapRpcHookArgs) {
6060
* @param handler - The handler to use. Defaults to `onRpcRequest`.
6161
* @returns The response.
6262
*/
63-
export function request(
63+
export async function request(
6464
page: Page,
6565
{ origin = 'metamask.io', ...options }: RequestOptions,
6666
handler:
@@ -163,6 +163,6 @@ export async function sendTransaction(
163163
* @param options - The request options.
164164
* @returns The response.
165165
*/
166-
export function runCronjob(page: Page, options: CronjobOptions) {
166+
export async function runCronjob(page: Page, options: CronjobOptions) {
167167
return request(page, options, HandlerType.OnCronjob);
168168
}

packages/test-snaps/.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,11 @@ module.exports = {
44
parserOptions: {
55
tsconfigRootDir: __dirname,
66
},
7+
8+
ignorePatterns: [
9+
'!.prettierrc.js',
10+
'**/!.eslintrc.js',
11+
'**/.cache/**',
12+
'**/public/**',
13+
],
714
};

packages/test-snaps/src/components/Connect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { graphql, useStaticQuery } from 'gatsby';
33
import { ChangeEvent, FormEvent, FunctionComponent, useState } from 'react';
44
import { Button, Form } from 'react-bootstrap';
55

6-
import { ButtonSpinner } from './ButtonSpinner';
76
import { useInstallSnapMutation } from '../api';
87
import { useInstalled } from '../utils';
8+
import { ButtonSpinner } from './ButtonSpinner';
99

1010
type ConnectProps = {
1111
name: string;

packages/test-snaps/src/components/Snap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { FunctionComponent, ReactNode } from 'react';
22
import { Card, Col } from 'react-bootstrap';
33
import CardHeader from 'react-bootstrap/CardHeader';
44

5-
import { Connect } from './Connect';
65
import { getSnapId } from '../utils';
6+
import { Connect } from './Connect';
77

88
export type SnapProps = {
99
/**

packages/test-snaps/src/features/snaps/bip32/BIP32.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FunctionComponent } from 'react';
22

3+
import { Snap } from '../../../components';
34
import { PublicKey, SignMessage } from './components';
45
import { BIP_32_PORT, BIP_32_SNAP_ID } from './constants';
5-
import { Snap } from '../../../components';
66

77
export const BIP32: FunctionComponent = () => {
88
return (

packages/test-snaps/src/features/snaps/bip44/BIP44.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button, ButtonGroup } from 'react-bootstrap';
44

5-
import { SignMessage } from './components';
6-
import { BIP_44_PORT, BIP_44_SNAP_ID } from './constants';
75
import { useInvokeMutation } from '../../../api';
86
import { Result, Snap } from '../../../components';
97
import { getSnapId } from '../../../utils';
8+
import { SignMessage } from './components';
9+
import { BIP_44_PORT, BIP_44_SNAP_ID } from './constants';
1010

1111
export const BIP44: FunctionComponent = () => {
1212
const [invokeSnap, { isLoading, data, error }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/cronjobs/Cronjobs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FunctionComponent } from 'react';
22

3-
import { CRONJOBS_SNAP_ID, CRONJOBS_SNAP_PORT } from './constants';
43
import { Snap } from '../../../components';
4+
import { CRONJOBS_SNAP_ID, CRONJOBS_SNAP_PORT } from './constants';
55

66
export const Cronjobs: FunctionComponent = () => {
77
return (

packages/test-snaps/src/features/snaps/dialogs/Dialogs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button, ButtonGroup } from 'react-bootstrap';
44

5-
import { DIALOGS_SNAP_ID, DIALOGS_SNAP_PORT } from './constants';
65
import { useInvokeMutation } from '../../../api';
76
import { Result, Snap } from '../../../components';
87
import { getSnapId } from '../../../utils';
8+
import { DIALOGS_SNAP_ID, DIALOGS_SNAP_PORT } from './constants';
99

1010
export const Dialogs: FunctionComponent = () => {
1111
const [invokeSnap, { isLoading, data }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/errors/Errors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button } from 'react-bootstrap';
44

5-
import { ERRORS_SNAP_ID, ERRORS_SNAP_PORT } from './constants';
65
import { useInvokeMutation } from '../../../api';
76
import { Result, Snap } from '../../../components';
87
import { getSnapId } from '../../../utils';
8+
import { ERRORS_SNAP_ID, ERRORS_SNAP_PORT } from './constants';
99

1010
export const Errors: FunctionComponent = () => {
1111
const [invokeSnap, { isLoading, data, error }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/ethereum-provider/EthereumProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button } from 'react-bootstrap';
44

5+
import { useInvokeMutation } from '../../../api';
6+
import { Result, Snap } from '../../../components';
7+
import { getSnapId } from '../../../utils';
58
import {
69
ETHEREUM_PROVIDER_SNAP_ID,
710
ETHEREUM_PROVIDER_SNAP_PORT,
811
} from './constants';
9-
import { useInvokeMutation } from '../../../api';
10-
import { Result, Snap } from '../../../components';
11-
import { getSnapId } from '../../../utils';
1212

1313
export const EthereumProvider: FunctionComponent = () => {
1414
const [invokeSnap, { isLoading, data, error }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/ethers-js/EthersJs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FunctionComponent } from 'react';
22

3+
import { Snap } from '../../../components';
34
import { SignMessage } from './components';
45
import { ETHERS_JS_PORT, ETHERS_JS_SNAP_ID } from './constants';
5-
import { Snap } from '../../../components';
66

77
export const EthersJs: FunctionComponent = () => {
88
return (

packages/test-snaps/src/features/snaps/get-entropy/GetEntropy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FunctionComponent } from 'react';
22

3+
import { Snap } from '../../../components';
34
import { SignMessage } from './components';
45
import { GET_ENTROPY_PORT, GET_ENTROPY_SNAP_ID } from './constants';
5-
import { Snap } from '../../../components';
66

77
export const GetEntropy: FunctionComponent = () => {
88
return (

packages/test-snaps/src/features/snaps/json-rpc/JsonRpc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button } from 'react-bootstrap';
44

5-
import { JSON_RPC_SNAP_ID, JSON_RPC_SNAP_PORT } from './constants';
65
import { useInvokeMutation } from '../../../api';
76
import { Result, Snap } from '../../../components';
87
import { getSnapId } from '../../../utils';
8+
import { JSON_RPC_SNAP_ID, JSON_RPC_SNAP_PORT } from './constants';
99

1010
export const JsonRpc: FunctionComponent = () => {
1111
const [invokeSnap, { isLoading, data, error }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/manage-state/ManageState.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { FunctionComponent } from 'react';
22

3+
import { Result, Snap } from '../../../components';
34
import { ClearData, SendData } from './components';
45
import { MANAGE_STATE_SNAP_ID, MANAGE_STATE_PORT } from './constants';
56
import { useSnapState } from './hooks';
6-
import { Result, Snap } from '../../../components';
77

88
export const ManageState: FunctionComponent = () => {
99
const state = useSnapState();

packages/test-snaps/src/features/snaps/network-access/NetworkAccess.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button } from 'react-bootstrap';
44

5-
import { NETWORK_ACCESS_PORT, NETWORK_ACCESS_SNAP_ID } from './constants';
65
import { useInvokeMutation } from '../../../api';
76
import { Snap } from '../../../components';
87
import { getSnapId } from '../../../utils';
8+
import { NETWORK_ACCESS_PORT, NETWORK_ACCESS_SNAP_ID } from './constants';
99

1010
export const NetworkAccess: FunctionComponent = () => {
1111
const [invokeSnap, { isLoading }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/notifications/Notifications.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button, ButtonGroup } from 'react-bootstrap';
44

5-
import { NOTIFICATIONS_SNAP_ID, NOTIFICATIONS_SNAP_PORT } from './constants';
65
import { useInvokeMutation } from '../../../api';
76
import { Snap } from '../../../components';
87
import { getSnapId } from '../../../utils';
8+
import { NOTIFICATIONS_SNAP_ID, NOTIFICATIONS_SNAP_PORT } from './constants';
99

1010
export const Notifications: FunctionComponent = () => {
1111
const [invokeSnap, { isLoading }] = useInvokeMutation();

packages/test-snaps/src/features/snaps/transaction-insights/TransactionInsights.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { assert } from '@metamask/utils';
33
import { FunctionComponent } from 'react';
44
import { Button, ButtonGroup } from 'react-bootstrap';
55

6+
import { useLazyGetAccountsQuery, useLazyRequestQuery } from '../../../api';
7+
import { Snap, Result } from '../../../components';
68
import {
79
TRANSACTION_INSIGHTS_SNAP_ID,
810
TRANSACTION_INSIGHTS_SNAP_PORT,
911
} from './constants';
10-
import { useLazyGetAccountsQuery, useLazyRequestQuery } from '../../../api';
11-
import { Snap, Result } from '../../../components';
1212

1313
export const TransactionInsights: FunctionComponent = () => {
1414
const [getAccounts, { isLoading: isLoadingAccounts, data: accounts }] =

packages/test-snaps/src/features/snaps/updates/Updates.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { logError } from '@metamask/snaps-utils';
22
import { FunctionComponent } from 'react';
33
import { Button, ButtonGroup } from 'react-bootstrap';
44

5+
import { useGetSnapsQuery, useInstallSnapMutation } from '../../../api';
6+
import { Result, Snap } from '../../../components';
57
import {
68
UPDATES_SNAP_ID,
79
UPDATES_SNAP_NEW_VERSION,
810
UPDATES_SNAP_OLD_VERSION,
911
} from './constants';
10-
import { useGetSnapsQuery, useInstallSnapMutation } from '../../../api';
11-
import { Result, Snap } from '../../../components';
1212

1313
export const Updates: FunctionComponent = () => {
1414
const [installSnap, { isLoading }] = useInstallSnapMutation();

packages/test-snaps/src/features/snaps/wasm/WebAssembly.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FunctionComponent } from 'react';
22

3+
import { Snap } from '../../../components';
34
import { FibonacciInput } from './components';
45
import { WASM_SNAP_ID, WASM_SNAP_PORT } from './constants';
5-
import { Snap } from '../../../components';
66

77
export const WASM: FunctionComponent = () => {
88
return (

scripts/verify-tsconfig.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
55
const cwd = pathUtils.dirname(fileURLToPath(import.meta.url))
66

77
// These are the packages we expect to _not_ be referenced in the root tsconfig.
8-
const IGNORE_LIST = new Set(['examples', 'snaps-types']);
8+
const IGNORE_LIST = new Set(['examples', 'snaps-types', 'test-snaps']);
99

1010
// Get reference paths from root tsconfig.json
1111
const rootTsconfig = JSON.parse(await fs.readFile('./tsconfig.json', { encoding: 'utf8' }));

tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
{ "path": "./packages/snaps-webpack-plugin" }
1616
],
1717
"compilerOptions": {
18+
"strict": true,
19+
"strictNullChecks": true,
1820
"esModuleInterop": true,
1921
"noEmit": true,
2022
"resolveJsonModule": true

0 commit comments

Comments
 (0)