We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isMemberExpression
1 parent 8b2bc0b commit ae37793Copy full SHA for ae37793
rules/prefer-string-raw.js
@@ -1,4 +1,4 @@
1
-import {isStringLiteral, isDirective} from './ast/index.js';
+import {isStringLiteral, isDirective, isMemberExpression} from './ast/index.js';
2
import {fixSpaceAroundKeyword} from './fix/index.js';
3
4
const MESSAGE_ID = 'prefer-string-raw';
@@ -70,12 +70,7 @@ const create = context => {
70
context.on('TaggedTemplateExpression', node => {
71
const {quasi, tag} = node;
72
73
- if (tag.type !== 'MemberExpression'
74
- || tag.object.type !== 'Identifier'
75
- || tag.property.type !== 'Identifier'
76
- || tag.object.name !== 'String'
77
- || tag.property.name !== 'raw'
78
- ) {
+ if (!isMemberExpression(tag, {object: 'String', property: 'raw'})) {
79
return;
80
}
81
0 commit comments