From ded9548d881b15e771ca79b844e8159601f30f70 Mon Sep 17 00:00:00 2001 From: golopot Date: Sat, 22 Jun 2019 07:41:23 +0800 Subject: [PATCH] Fix: multiline-comment-style incorrect message (#11864) --- 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 }] } ] });