Skip to content

Commit 5bdc0b3

Browse files
authored
chore: Fix development peerDependency warnings (#468)
* chore: Fix development `peerDependency` warnings The `@lavamoat/preinstall-always-fail` package has been added, and the package `eslint-plugin-import` package has been downgraded by a minor version, both to meet `peerDependency` requirements of other development dependencies. Resolves two warnings, no functional changes. * Fix import order lint errors and remove unnecessary comments * Restore necessary ts-ignore comment
1 parent cf6c4ab commit 5bdc0b3

File tree

5 files changed

+490
-307
lines changed

5 files changed

+490
-307
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
},
4444
"devDependencies": {
4545
"@lavamoat/allow-scripts": "^3.2.1",
46+
"@lavamoat/preinstall-always-fail": "^2.1.0",
4647
"@metamask/auto-changelog": "^3.1.0",
4748
"@metamask/eslint-config": "^12.2.0",
4849
"@metamask/eslint-config-jest": "^12.1.0",
@@ -58,7 +59,7 @@
5859
"@typescript-eslint/parser": "^5.33.0",
5960
"eslint": "^8.48.0",
6061
"eslint-config-prettier": "^8.8.0",
61-
"eslint-plugin-import": "^2.27.5",
62+
"eslint-plugin-import": "~2.26.0",
6263
"eslint-plugin-jest": "^27.1.5",
6364
"eslint-plugin-jsdoc": "^39.2.9",
6465
"eslint-plugin-n": "^15.7.0",

src/SmartTransactionsController.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
import nock from 'nock';
1818
import * as sinon from 'sinon';
1919

20-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
21-
// @ts-ignore
20+
import packageJson from '../package.json';
21+
import { advanceTime, flushPromises, getFakeProvider } from '../tests/helpers';
2222
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
2323
import SmartTransactionsController, {
2424
DEFAULT_INTERVAL,
@@ -33,8 +33,6 @@ import type {
3333
import type { SmartTransaction, UnsignedTransaction, Hex } from './types';
3434
import { SmartTransactionStatuses } from './types';
3535
import * as utils from './utils';
36-
import packageJson from '../package.json';
37-
import { advanceTime, flushPromises, getFakeProvider } from '../tests/helpers';
3836

3937
jest.mock('@ethersproject/bytes', () => ({
4038
...jest.requireActual('@ethersproject/bytes'),

src/utils.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ChainId } from '@metamask/controller-utils';
22

3-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4-
// @ts-ignore
3+
import packageJson from '../package.json';
54
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
65
import {
76
SmartTransactionMinedTx,
@@ -10,7 +9,6 @@ import {
109
SmartTransactionCancellationReason,
1110
} from './types';
1211
import * as utils from './utils';
13-
import packageJson from '../package.json';
1412

1513
const createSignedTransaction = () => {
1614
return '0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a02b79f322a625d623a2bb2911e0c6b3e7eaf741a7c7c5d2e8c67ef3ff4acf146ca01ae168fea63dc3391b75b586c8a7c0cb55cdf3b8e2e4d8e097957a3a56c6f2c5';

src/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import { BigNumber } from 'bignumber.js';
55
import jsonDiffer from 'fast-json-patch';
66
import _ from 'lodash';
77

8+
// Ignoring TypeScript errors here because this import is disallowed for production builds, because
9+
// the `package.json` file is above the root directory.
810
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
11+
// @ts-ignore
12+
import packageJson from '../package.json';
913
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
1014
import type { SmartTransaction, SmartTransactionsStatus } from './types';
1115
import {
@@ -15,9 +19,6 @@ import {
1519
SmartTransactionMinedTx,
1620
cancellationReasonToStatusMap,
1721
} from './types';
18-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
19-
// @ts-ignore
20-
import packageJson from '../package.json';
2122

2223
export function isSmartTransactionPending(smartTransaction: SmartTransaction) {
2324
return smartTransaction.status === SmartTransactionStatuses.PENDING;

0 commit comments

Comments
 (0)