Skip to content

Commit c0f6400

Browse files
committed
chore: disable eslint rules in a few specific places
The main disable here is disabling unicorn/prefer-math-min-max where it would downcast bigints to numbers.
1 parent ad6fb37 commit c0f6400

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

apps/staking/src/components/Dashboard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ const useIntegrityStakingSum = (
246246
[publishers, field],
247247
);
248248

249-
// eslint-disable-next-line unicorn/no-array-reduce
249+
// eslint-disable-next-line unicorn/no-array-reduce, unicorn/prefer-math-min-max
250250
const bigIntMin = (...args: bigint[]) => args.reduce((m, e) => (e < m ? e : m));
251251

252252
type TabId = Exclude<ComponentProps<typeof Tabs>["selectedKey"], undefined>;

governance/pyth_staking_sdk/src/pyth-staking-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ export class PythStakingClient {
809809
for (const instruction of instructions.advanceDelegationRecordInstructions) {
810810
const tx = new Transaction().add(instruction);
811811
tx.feePayer = simulationPayer ?? this.wallet.publicKey;
812+
// eslint-disable-next-line @typescript-eslint/no-deprecated
812813
const res = await this.connection.simulateTransaction(tx);
813814
const val = res.value.returnData?.data[0];
814815
if (val === undefined) {

governance/pyth_staking_sdk/src/utils/apy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export const calculateApy = (
1717
} & ({ isSelf: true } | { isSelf: false; poolUtilization: bigint }),
1818
) => {
1919
const { selfStake, poolCapacity, yieldRate, isSelf } = options;
20+
// This eslint rule incorrectly tries to use Math.min() here instead, which
21+
// casts down to number
22+
// eslint-disable-next-line unicorn/prefer-math-min-max
2023
const eligibleSelfStake = selfStake > poolCapacity ? poolCapacity : selfStake;
2124

2225
if (poolCapacity === 0n) {
@@ -40,6 +43,9 @@ export const calculateApy = (
4043
const delegatorPoolUtilization = poolUtilization - selfStake;
4144
const delegatorPoolCapacity = poolCapacity - eligibleSelfStake;
4245
const eligibleStake =
46+
// This eslint rule incorrectly tries to use Math.min() here instead, which
47+
// casts down to number
48+
// eslint-disable-next-line unicorn/prefer-math-min-max
4349
delegatorPoolUtilization > delegatorPoolCapacity
4450
? delegatorPoolCapacity
4551
: delegatorPoolUtilization;

0 commit comments

Comments
 (0)