From 88ec1bd344c36619267545086db085b05cb4df61 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:25:34 +0000 Subject: [PATCH] fix(linter/plugins): fix error messages (#14423) Fix a typo in 1 error message, and add quotes to another, following formatting convention used elsewhere. --- apps/oxlint/src-js/plugins/context.ts | 4 ++-- apps/oxlint/test/fixtures/message_id_error/output.snap.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/oxlint/src-js/plugins/context.ts b/apps/oxlint/src-js/plugins/context.ts index c7b6ce19cfe4d..87ab5b498f754 100644 --- a/apps/oxlint/src-js/plugins/context.ts +++ b/apps/oxlint/src-js/plugins/context.ts @@ -256,12 +256,12 @@ function getMessage(diagnostic: Diagnostic, internal: InternalContext): string { function resolveMessageFromMessageId(messageId: string, internal: InternalContext): string { const { messages } = internal; if (messages === null) { - throw new Error(`Cannot use messageId '${messageId}' - rule does not define any messages in meta.messages`); + throw new Error(`Cannot use messageId '${messageId}' - rule does not define any messages in \`meta.messages\``); } if (!hasOwn(messages, messageId)) { throw new Error( - `Unknown messageId '${messageId}'. Available messages: ${ + `Unknown messageId '${messageId}'. Available \`messageIds\`: ${ ObjectKeys(messages).map((msg) => `'${msg}'`).join(', ') }`, ); diff --git a/apps/oxlint/test/fixtures/message_id_error/output.snap.md b/apps/oxlint/test/fixtures/message_id_error/output.snap.md index f79439823f81f..da55bbb274e15 100644 --- a/apps/oxlint/test/fixtures/message_id_error/output.snap.md +++ b/apps/oxlint/test/fixtures/message_id_error/output.snap.md @@ -5,7 +5,7 @@ ``` x Error running JS plugin. | File path: /apps/oxlint/test/fixtures/message_id_error/files/index.js - | Error: Unknown messageId 'unknownMessage'. Available messages: 'validMessage' + | Error: Unknown messageId 'unknownMessage'. Available `messageIds`: 'validMessage' | at DebuggerStatement (/apps/oxlint/test/fixtures/message_id_error/plugin.ts:18:21) Found 0 warnings and 1 error.