Skip to content

Commit 88ec1bd

Browse files
committed
fix(linter/plugins): fix error messages (#14423)
Fix a typo in 1 error message, and add quotes to another, following formatting convention used elsewhere.
1 parent 5e99ed3 commit 88ec1bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/oxlint/src-js/plugins/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ function getMessage(diagnostic: Diagnostic, internal: InternalContext): string {
256256
function resolveMessageFromMessageId(messageId: string, internal: InternalContext): string {
257257
const { messages } = internal;
258258
if (messages === null) {
259-
throw new Error(`Cannot use messageId '${messageId}' - rule does not define any messages in meta.messages`);
259+
throw new Error(`Cannot use messageId '${messageId}' - rule does not define any messages in \`meta.messages\``);
260260
}
261261

262262
if (!hasOwn(messages, messageId)) {
263263
throw new Error(
264-
`Unknown messageId '${messageId}'. Available messages: ${
264+
`Unknown messageId '${messageId}'. Available \`messageIds\`: ${
265265
ObjectKeys(messages).map((msg) => `'${msg}'`).join(', ')
266266
}`,
267267
);

apps/oxlint/test/fixtures/message_id_error/output.snap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
```
66
x Error running JS plugin.
77
| File path: <root>/apps/oxlint/test/fixtures/message_id_error/files/index.js
8-
| Error: Unknown messageId 'unknownMessage'. Available messages: 'validMessage'
8+
| Error: Unknown messageId 'unknownMessage'. Available `messageIds`: 'validMessage'
99
| at DebuggerStatement (<root>/apps/oxlint/test/fixtures/message_id_error/plugin.ts:18:21)
1010
1111
Found 0 warnings and 1 error.

0 commit comments

Comments
 (0)