From 92246ab65da5c9be2b839d3243aecab0edb21558 Mon Sep 17 00:00:00 2001 From: golopot Date: Thu, 20 Jun 2019 23:38:16 +0800 Subject: [PATCH] Fix: multiline-comment-style incorrect message --- lib/rules/multiline-comment-style.js | 3 ++- tests/lib/rules/multiline-comment-style.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/rules/multiline-comment-style.js b/lib/rules/multiline-comment-style.js index e4470c20f43..6578a120126 100644 --- a/lib/rules/multiline-comment-style.js +++ b/lib/rules/multiline-comment-style.js @@ -25,6 +25,7 @@ module.exports = { schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], messages: { expectedBlock: "Expected a block comment instead of consecutive line comments.", + expectedBareBlock: "Expected a block comment without padding stars.", startNewline: "Expected a linebreak after '/*'.", endNewline: "Expected a linebreak before '*/'.", missingStar: "Expected a '*' at the start of this line.", @@ -250,7 +251,7 @@ module.exports = { start: block.loc.start, end: { line: block.loc.start.line, column: block.loc.start.column + 2 } }, - messageId: "expectedBlock", + messageId: "expectedBareBlock", fix(fixer) { return fixer.replaceText(block, convertToBlock(block, commentLines.filter(line => line))); } diff --git a/tests/lib/rules/multiline-comment-style.js b/tests/lib/rules/multiline-comment-style.js index 04104c00ca2..58c13581d4d 100644 --- a/tests/lib/rules/multiline-comment-style.js +++ b/tests/lib/rules/multiline-comment-style.js @@ -481,7 +481,7 @@ ruleTester.run("multiline-comment-style", rule, { bar */ `, options: ["bare-block"], - errors: [{ messageId: "expectedBlock", line: 2 }] + errors: [{ messageId: "expectedBareBlock", line: 2 }] } ] });