Skip to content

Commit

Permalink
chore: Fix development peerDependency warnings (#468)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Gudahtt authored Nov 26, 2024
1 parent cf6c4ab commit 5bdc0b3
Show file tree
Hide file tree
Showing 5 changed files with 490 additions and 307 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"devDependencies": {
"@lavamoat/allow-scripts": "^3.2.1",
"@lavamoat/preinstall-always-fail": "^2.1.0",
"@metamask/auto-changelog": "^3.1.0",
"@metamask/eslint-config": "^12.2.0",
"@metamask/eslint-config-jest": "^12.1.0",
Expand All @@ -58,7 +59,7 @@
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "~2.26.0",
"eslint-plugin-jest": "^27.1.5",
"eslint-plugin-jsdoc": "^39.2.9",
"eslint-plugin-n": "^15.7.0",
Expand Down
6 changes: 2 additions & 4 deletions src/SmartTransactionsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
import nock from 'nock';
import * as sinon from 'sinon';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import packageJson from '../package.json';
import { advanceTime, flushPromises, getFakeProvider } from '../tests/helpers';
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
import SmartTransactionsController, {
DEFAULT_INTERVAL,
Expand All @@ -33,8 +33,6 @@ import type {
import type { SmartTransaction, UnsignedTransaction, Hex } from './types';
import { SmartTransactionStatuses } from './types';
import * as utils from './utils';
import packageJson from '../package.json';
import { advanceTime, flushPromises, getFakeProvider } from '../tests/helpers';

jest.mock('@ethersproject/bytes', () => ({
...jest.requireActual('@ethersproject/bytes'),
Expand Down
4 changes: 1 addition & 3 deletions src/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ChainId } from '@metamask/controller-utils';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import packageJson from '../package.json';
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
import {
SmartTransactionMinedTx,
Expand All @@ -10,7 +9,6 @@ import {
SmartTransactionCancellationReason,
} from './types';
import * as utils from './utils';
import packageJson from '../package.json';

const createSignedTransaction = () => {
return '0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a02b79f322a625d623a2bb2911e0c6b3e7eaf741a7c7c5d2e8c67ef3ff4acf146ca01ae168fea63dc3391b75b586c8a7c0cb55cdf3b8e2e4d8e097957a3a56c6f2c5';
Expand Down
7 changes: 4 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import { BigNumber } from 'bignumber.js';
import jsonDiffer from 'fast-json-patch';
import _ from 'lodash';

// Ignoring TypeScript errors here because this import is disallowed for production builds, because
// the `package.json` file is above the root directory.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import packageJson from '../package.json';
import { API_BASE_URL, SENTINEL_API_BASE_URL_MAP } from './constants';
import type { SmartTransaction, SmartTransactionsStatus } from './types';
import {
Expand All @@ -15,9 +19,6 @@ import {
SmartTransactionMinedTx,
cancellationReasonToStatusMap,
} from './types';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import packageJson from '../package.json';

export function isSmartTransactionPending(smartTransaction: SmartTransaction) {
return smartTransaction.status === SmartTransactionStatuses.PENDING;
Expand Down
Loading

0 comments on commit 5bdc0b3

Please sign in to comment.