Skip to content

Commit

Permalink
diff msg for suggestion than main warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Singh1 committed Dec 11, 2021
1 parent d6dcde5 commit 300f349
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 122 deletions.
3 changes: 2 additions & 1 deletion lib/rules/prefer-regex-literals.js
Expand Up @@ -144,6 +144,7 @@ module.exports = {

messages: {
unexpectedRegExp: "Use a regular expression literal instead of the 'RegExp' constructor.",
replaceWithLiteral: "Replace with an equivalent regular expression literal.",
unexpectedRedundantRegExp: "Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
unexpectedRedundantRegExpWithFlags: "Use regular expression literal with flags instead of the 'RegExp' constructor."
}
Expand Down Expand Up @@ -373,7 +374,7 @@ module.exports = {
node,
messageId: "unexpectedRegExp",
suggest: noFix ? [] : [{
messageId: "unexpectedRegExp",
messageId: "replaceWithLiteral",
fix(fixer) {
const tokenAfter = sourceCode.getTokenAfter(node);

Expand Down

0 comments on commit 300f349

Please sign in to comment.