Skip to content

Commit

Permalink
Return earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 9, 2024
1 parent 3fcf69d commit 977a9d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rules/prefer-string-raw.js
Expand Up @@ -53,7 +53,8 @@ const create = context => {

const {raw} = node;
if (
!raw.includes(BACKSLASH + BACKSLASH)
raw.endsWith(BACKSLASH)
|| !raw.includes(BACKSLASH + BACKSLASH)
|| raw.includes('`')
|| raw.includes('${')
|| node.loc.start.line !== node.loc.end.line
Expand All @@ -62,7 +63,7 @@ const create = context => {
}

const unescaped = unescapeBackslash(raw);
if (unescaped.endsWith(BACKSLASH) || unescaped !== node.value) {
if (unescaped !== node.value) {
return;
}

Expand Down

0 comments on commit 977a9d8

Please sign in to comment.