Skip to content

Commit

Permalink
Fix Eslint errors (#3466)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva authored Oct 27, 2024
1 parent 0245265 commit 333592a
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 20 deletions.
2 changes: 0 additions & 2 deletions packages/codecs-data-structures/src/__tests__/boolean-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ describe('getBooleanCodec', () => {
// and the max shortU16 value for `true`.
const mappedShortU16 = transformCodec(
getShortU16Codec(),
// eslint-disable-next-line jest/no-conditional-in-test
v => (v === 0 ? 0 : 0xffff),
// eslint-disable-next-line jest/no-conditional-in-test
v => (v === 0 ? 0 : 1),
);

Expand Down
1 change: 0 additions & 1 deletion packages/rpc-graphql/src/resolvers/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export function mapJsonParsedInnerInstructions(
): { index: number; instructions: InstructionResult[] }[] {
return innerInstructions.map(({ index, instructions }) => ({
index,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
instructions: mapJsonParsedInstructions(instructions),
}));
}
Expand Down
1 change: 0 additions & 1 deletion packages/rpc-graphql/src/schema/type-defs/transaction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
export const transactionTypeDefs = /* GraphQL */ `
type TransactionStatusOk {
Ok: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { Address } from '@solana/addresses';
import type { PendingRpcSubscriptionsRequest, RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { Address } from '@solana/addresses';
import type { Signature } from '@solana/keys';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { Address } from '@solana/addresses';
import type { PendingRpcSubscriptionsRequest, RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { PendingRpcSubscriptionsRequest, RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
import type { Slot } from '@solana/rpc-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { Signature } from '@solana/keys';
import type { PendingRpcSubscriptionsRequest, RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */

import type { RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
import type { Slot } from '@solana/rpc-types';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { PendingRpcSubscriptionsRequest, RpcSubscriptions } from '@solana/rpc-subscriptions-spec';
import type { Slot, U64 } from '@solana/rpc-types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-floating-promises */
import type { Address } from '@solana/addresses';
import type { Signature } from '@solana/keys';
Expand Down
9 changes: 4 additions & 5 deletions packages/rpc-subscriptions/src/rpc-subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ import {
import type { RpcSubscriptionsFromTransport } from './rpc-subscriptions-clusters';
import { createDefaultRpcSubscriptionsTransport } from './rpc-subscriptions-transport';

interface DefaultRpcSubscriptionsConfig<TClusterUrl extends ClusterUrl>
extends DefaultRpcSubscriptionsChannelConfig<TClusterUrl> {}
type Config<TClusterUrl extends ClusterUrl> = DefaultRpcSubscriptionsChannelConfig<TClusterUrl>;

function createSolanaRpcSubscriptionsImpl<TClusterUrl extends ClusterUrl, TApi extends RpcSubscriptionsApiMethods>(
clusterUrl: TClusterUrl,
config?: Omit<DefaultRpcSubscriptionsConfig<TClusterUrl>, 'url'>,
config?: Omit<Config<TClusterUrl>, 'url'>,
) {
const transport = createDefaultRpcSubscriptionsTransport({
createChannel: createDefaultSolanaRpcSubscriptionsChannelCreator({ ...config, url: clusterUrl }),
Expand All @@ -30,14 +29,14 @@ function createSolanaRpcSubscriptionsImpl<TClusterUrl extends ClusterUrl, TApi e

export function createSolanaRpcSubscriptions<TClusterUrl extends ClusterUrl>(
clusterUrl: TClusterUrl,
config?: Omit<DefaultRpcSubscriptionsConfig<TClusterUrl>, 'url'>,
config?: Omit<Config<TClusterUrl>, 'url'>,
) {
return createSolanaRpcSubscriptionsImpl<TClusterUrl, SolanaRpcSubscriptionsApi>(clusterUrl, config);
}

export function createSolanaRpcSubscriptions_UNSTABLE<TClusterUrl extends ClusterUrl>(
clusterUrl: TClusterUrl,
config?: Omit<DefaultRpcSubscriptionsConfig<TClusterUrl>, 'url'>,
config?: Omit<Config<TClusterUrl>, 'url'>,
) {
return createSolanaRpcSubscriptionsImpl<TClusterUrl, SolanaRpcSubscriptionsApi & SolanaRpcSubscriptionsApiUnstable>(
clusterUrl,
Expand Down
2 changes: 0 additions & 2 deletions packages/rpc/src/__tests__/rpc-request-coalescer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,12 @@ describe('RPC request coalescer', () => {
abortControllerA.abort('o no A');
abortControllerB.abort('o no B');
jest.runAllTicks();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const transportAbortSignal = mockTransport.mock.lastCall![0].signal!;
expect(transportAbortSignal.aborted).toBe(true);
});
it('does not abort the transport if fewer than every request aborts', () => {
expect.assertions(1);
abortControllerA.abort('o no A');
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const transportAbortSignal = mockTransport.mock.lastCall![0].signal!;
expect(transportAbortSignal.aborted).toBe(false);
});
Expand Down

0 comments on commit 333592a

Please sign in to comment.