no raw text rule fail
tomdyqin opened this issue · comments
Did this happen after the latest release?
Did this happen after the latest release?
Same issue here. Indeed after upgrading to 3.9.0
This seems to be related with #247 .
This PR was created to allow components that use dot notation to work (ie: Animated.Text
). This rule works by checking if the component name is in a list of allowed components that can contain text. But the function used to get the component name now is also appending the prop names to the component name.
This happens in this function:
eslint-plugin-react-native/lib/rules/no-raw-text.js
Lines 10 to 24 in 886999a
Changing this section fixes the problem:
traverse(element, {
JSXIdentifier({ node: identifier }) {
if (identifier.parent.type === 'JSXOpeningElement' || identifier.parent.type === 'JSXMemberExpression') {
identifiers.push(identifier.name);
}
},
}, scope);
I'll make some more tests and send a new PR to fix this issue.