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 4f2a2ff commit 5b4fe3fCopy full SHA for 5b4fe3f
lib/rules/jsx-no-literals.js
@@ -107,9 +107,9 @@ module.exports = {
107
108
function isParentNodeStandard() {
109
if (!/^[\s]+$/.test(node.value) && typeof node.value === 'string' && parent.type.includes('JSX')) {
110
-
111
if (config.noAttributeStrings) {
112
- return (parent.type === 'JSXAttribute' || parent.type === 'JSXElement') && !config.allowedProps.has(parent.name?.name);
+ const isAllowedProp = parent.name && config.allowedProps.has(parent.name.name);
+ return (parent.type === 'JSXAttribute' || parent.type === 'JSXElement') && !isAllowedProp;
113
}
114
if (!config.noAttributeStrings) {
115
return parent.type !== 'JSXAttribute';
0 commit comments