style/noReactNativeLiteralColors
style · since 2.4.13
No autofix
biome.json
{
"linter": {
"rules": {
"style": {
"noReactNativeLiteralColors": "error"
}
}
}
}const Hello = () => <Text style={{ backgroundColor: '#FFFFFF' }}>hi</Text>;const styles = StyleSheet.create({
text: { color: 'red' }
});const Hello = (flag) => (
<Text style={{ backgroundColor: flag ? '#fff' : '#000' }}>hi</Text>
);const red = '#f00';
const styles = StyleSheet.create({
text: { color: red }
});const Hello = () => (
<Text style={{ backgroundColor: theme.background }}>hi</Text>
);Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
ESLint does not have this rule.
Oxlint does not have this rule.
style/noReactNativeLiteralColors
style · since 2.4.13
{
"linter": {
"rules": {
"style": {
"noReactNativeLiteralColors": "error"
}
}
}
}Replaces usages of forwardRef with passing ref as a prop.
Disallow pseudo-elements inside :is(), :where(), :not() and :has().
Disallow dependencies that are known to have better alternatives.