no-raw-text nested text issue
On "eslint-plugin-react-native": "3.9.1" there seems to be a false positive error/warning
<Text testID="OuterTestId">
Message from
<Text numberOfLines={1} ellipsizeMode="middle" style={styles.middleText}>
{username}
</Text>
</Text>
There seems to be a problem with Nested Text for this rule.
The issue exists on v3.9.0 too. v3.8.1 is fine though. I'm testing with a custom text component like so:
"react-native/no-raw-text": [2, { "skip": [ "Label" ] }],
Any help on this issue is appreciated, I think its the same as this: https://github.com/Intellicode/eslint-plugin-react-native/issues/269
Still present in "eslint-plugin-react-native": "^3.10.0"
Still present in 3.11.0. As a workaround, you can configure the rule with { "skip": [ "Text.Text" ] }] (add "Text.Text.Text" for two levels of nesting etc).
Noticed in 3.11.0 too, cheers @ejain this works for me
'react-native/no-raw-text': ['error', { skip: 'Text.Text' }]
Yeah, I found this really confusing as nesting text like this is exactly what the React Native docs tell you to do. I made a YAML version of the workaround by ejain:
react-native/no-raw-text:
- error
- skip:
- 'Text.Text'