Skip to content

Commit

Permalink
Merge pull request #484 from ybiquitous/unify-messages-for-comment-no…
Browse files Browse the repository at this point in the history
…-empty

Unify messages for `comment-no-empty` and `scss/comment-no-empty`
  • Loading branch information
kristerkari committed Jul 19, 2021
2 parents 9c43853 + 8f66725 commit 384f294
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/rules/comment-no-empty/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,9 @@ testRule(rule, {
}
]
});

test("messages", () => {
expect(messages.rejected).toBe(
"Unexpected empty comment (scss/comment-no-empty)"
);
});
11 changes: 8 additions & 3 deletions src/rules/comment-no-empty/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { utils } from "stylelint";
import { rules, utils } from "stylelint";
import { namespace } from "../../utils";

export const ruleName = namespace("comment-no-empty");
const coreRuleName = "comment-no-empty";

export const ruleName = namespace(coreRuleName);

export const messages = utils.ruleMessages(ruleName, {
rejected: "Unexpected empty comment"
rejected: rules[coreRuleName].messages.rejected.replace(
` (${coreRuleName})`,
""
)
});

function rule(primary) {
Expand Down

0 comments on commit 384f294

Please sign in to comment.