yarn add -D @dbenfouzari/eslint-plugin-react-native
or if you are using npm
npm i -D @dbenfouzari/eslint-plugin-react-native
Enable it by inserting in your project
{
"plugins": ["@dbenfouzari/react-native"]
}
This rule will avoid you using text as children.
Useful when you want to enforce i18n
.
Example :
{
"plugins": ["@dbenfouzari/react-native"],
"rules": {
"@dbenfouzari/react-native/no-child-string": ["error"]
}
}