Skip to content

Commit

Permalink
Fix whitespace; move suppression to line to which it pertains
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Dec 9, 2024
1 parent 855060a commit ce189cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions packages/errors/src/message-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export function getHumanReadableErrorMessage<TErrorCode extends SolanaErrorCode>
const variableName = messageFormatString.slice(state[START_INDEX] + 1, endIndex);

fragments.push(
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
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 All @@ -44,8 +46,8 @@ export function getHumanReadableErrorMessage<TErrorCode extends SolanaErrorCode>
messageFormatString[0] === '\\'
? StateType.EscapeSequence
: messageFormatString[0] === '$'
? StateType.Variable
: StateType.Text,
? StateType.Variable
: StateType.Text,
};
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +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
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
expect(`${thrownError.context.headers}`).not.toMatch(/doNotLog/);
});
});
Expand Down

0 comments on commit ce189cf

Please sign in to comment.