nursery/useReactNativeValidPlatformColors
nursery · since 2.6.3
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"useReactNativeValidPlatformColors": "error"
}
}
}
}Require PlatformColor() and DynamicColorIOS() calls to use values written directly in the call.
import { PlatformColor } from "react-native";
const color = PlatformColor();import { PlatformColor } from "react-native";
const labelColor = "labelColor";
const color = PlatformColor(labelColor);import { DynamicColorIOS } from "react-native";
const colors = { light: "black", dark: "white" };
const color = DynamicColorIOS(colors);import { DynamicColorIOS, PlatformColor } from "react-native";
const label = PlatformColor("labelColor");
const accent = PlatformColor("controlAccentColor", "controlColor", { fallback: "red" });
const text = DynamicColorIOS({ light: "black", dark: PlatformColor("labelColor") });Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useReactNativeValidPlatformColors
nursery · since 2.6.3
{
"linter": {
"rules": {
"nursery": {
"useReactNativeValidPlatformColors": "error"
}
}
}
}Ensure that platform-specific React Native components are only imported in files named for that platform.
Disallow number literal object member names which are not base 10 or use underscore as separator.
Require functions with the "use server" directive to be async.
Require createEventDispatcher calls to declare the types of their events.
Disallow unserializable expressions in Qwik dollar ($) scopes.
Require internal navigation in SvelteKit apps to use paths built with resolve().