Skip to content

Commit 2eb20bf

Browse files
committed
refactor: update backslash check
1 parent be1ece7 commit 2eb20bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rules/prefer-string-raw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ const create = context => {
7676
return;
7777
}
7878

79-
const hasBackslash = quasi.quasis.some(
80-
quasi => quasi.value.raw.includes(BACKSLASH),
79+
const isFixable = quasi.quasis.every(
80+
({value: {raw, cooked}}) => raw === cooked,
8181
);
8282

83-
if (hasBackslash) {
83+
if (!isFixable) {
8484
return;
8585
}
8686

0 commit comments

Comments
 (0)