We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
prefer-string-raw
1 parent 94b6f5e commit 175ea04Copy full SHA for 175ea04
rules/prefer-string-raw.js
@@ -47,6 +47,7 @@ const create = context => {
47
)
48
|| (node.parent.type === 'Property' && !node.parent.computed && node.parent.key === node)
49
|| (node.parent.type === 'JSXAttribute' && node.parent.value === node)
50
+ || (node.parent.type === 'TSEnumMember' && (node.parent.initializer === node || node.parent.id === node))
51
) {
52
return;
53
}
test/prefer-string-raw.mjs
@@ -38,3 +38,19 @@ test.snapshot({
38
String.raw`const foo = "foo \\x46";`,
39
],
40
});
41
+
42
+test.typescript({
43
+ valid: [
44
+ outdent`
45
+ enum Files {
46
+ Foo = "C:\\\\path\\\\to\\\\foo.js",
+ }
+ `,
+ enum Foo {
+ "\\\\a\\\\b" = "baz",
54
+ ],
55
+ invalid: [],
56
+});
0 commit comments