Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable eslint restrict-template-expressions plugin has a few extra linting errors #3694

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/deserialize-transaction/src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ const decompiledTransactionMessage = await decompileTransactionMessageFetchingLo
// This is the same data structure that was created before we first signed the transaction

// We can see the fee payer:
log.info(`[step 3] The transaction fee payer is ${decompiledTransactionMessage.feePayer}`);
log.info(`[step 3] The transaction fee payer is ${decompiledTransactionMessage.feePayer.address}`);
kox marked this conversation as resolved.
Show resolved Hide resolved

// And the lifetime constraint:
log.info(decompiledTransactionMessage.lifetimeConstraint, '[step 3] The transaction lifetime constraint');
Expand Down
5 changes: 4 additions & 1 deletion packages/errors/src/message-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export function getHumanReadableErrorMessage<TErrorCode extends SolanaErrorCode>
const variableName = messageFormatString.slice(state[START_INDEX] + 1, endIndex);

fragments.push(
variableName in context ? `${context[variableName as keyof typeof context]}` : `$${variableName}`,
variableName in context
? // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
`${context[variableName as keyof typeof context]}`
: `$${variableName}`,
);
} else if (state[TYPE] === StateType.Text) {
fragments.push(messageFormatString.slice(state[START_INDEX], endIndex));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('createHttpTransport', () => {
thrownError = e as SolanaError<typeof SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR>;
}
expect(thrownError).toBeDefined();
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
expect(`${thrownError.context.headers}`).not.toMatch(/doNotLog/);
});
});
Expand Down