From a82a42765e4bc90cc4d7f24ab7881f94d8d6493c Mon Sep 17 00:00:00 2001 From: danishi Date: Sun, 5 May 2024 13:50:03 +0900 Subject: [PATCH] fix message. --- package.json | 2 +- src/index.js | 4 ++-- test/index-test.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b231e60..5d9bd24 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.0.0", + "version": "1.0.1", "name": "textlint-rule-gc-product-name", "description": "This rule checks Google Cloud product names.", "author": "danishi", diff --git a/src/index.js b/src/index.js index 7647f55..fbb2132 100644 --- a/src/index.js +++ b/src/index.js @@ -13,7 +13,7 @@ module.exports = function(context) { while ((match = correctRegExp.exec(text)) !== null) { // Check if it is written with accurate capitalization. if (match[0] !== term.correct) { - const ruleError = new RuleError(`It is correct to write "${term.correct}" exactly, with proper capitalization.`, { + const ruleError = new RuleError(`Correct to write "${term.correct}" exactly, with proper capitalization.`, { index: match.index }); report(node, ruleError); @@ -24,7 +24,7 @@ module.exports = function(context) { term.incorrect.forEach(incorrectTerm => { const incorrectRegExp = new RegExp(`\\b${incorrectTerm}\\b`, 'g'); while ((match = incorrectRegExp.exec(text)) !== null) { - const ruleError = new RuleError(`It is correct to write "${term.correct}".`, { + const ruleError = new RuleError(`Correct to write "${term.correct}".`, { index: match.index }); report(node, ruleError); diff --git a/test/index-test.js b/test/index-test.js index efe8b3b..e641bf5 100644 --- a/test/index-test.js +++ b/test/index-test.js @@ -16,7 +16,7 @@ tester.run("rule", rule, { text: `ComputeEngine is a product of Google Cloud.`, errors: [ { - message: 'It is correct to write "Compute Engine".', + message: 'Correct to write "Compute Engine".', range: [0, 1] } ] @@ -27,7 +27,7 @@ tester.run("rule", rule, { of Google cloud.`, errors: [ { - message: 'It is correct to write "Google Cloud" exactly, with proper capitalization.', + message: 'Correct to write "Google Cloud" exactly, with proper capitalization.', range: [32, 33] } ]