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.
1 parent 4cf6752 commit 2ae8d5eCopy full SHA for 2ae8d5e
lib/rules/jsx-no-literals.js
@@ -43,11 +43,15 @@ module.exports = {
43
}
44
45
function getValidation(node) {
46
+ let current = node;
47
+ while (current.parent.type === 'BinaryExpression') {
48
+ current = current.parent;
49
+ }
50
const standard = !/^[\s]+$/.test(node.value) &&
51
typeof node.value === 'string' &&
- node.parent &&
- node.parent.type.indexOf('JSX') !== -1 &&
- node.parent.type !== 'JSXAttribute';
52
+ current.parent &&
53
+ current.parent.type.indexOf('JSX') !== -1 &&
54
+ current.parent.type !== 'JSXAttribute';
55
if (isNoStrings) {
56
return standard;
57
0 commit comments