React Native
Mobile-specific rules and best practices for React Native projects.
Enabled Rules
| Rule | Severity | Description |
|---|---|---|
quality/naming-conventions | block | PascalCase components, use-prefixed hooks |
quality/no-deprecated-api | block | Catches deprecated React Native APIs |
quality/anti-patterns | warn | Inline styles in performance-sensitive components |
quality/hallucination-guard | warn | Verifies React Native imports exist |
security/secret-detection | block | Detects API keys hardcoded in mobile app code |
Usage
import { defineConfig } from '@solanticai/vguard';
export default defineConfig({
presets: ['react-native'],
});
What it enforces
- No deprecated APIs — Blocks usage of deprecated React Native components (
ListView,Navigator,ToolbarAndroid) and recommends modern alternatives. - Naming conventions — Screen components must be PascalCase with
Screensuffix (HomeScreen, nothome). Hooks must useuseprefix. - Performance patterns — Warns on inline style objects in
FlatListrenderItemand other performance-sensitive contexts. UseStyleSheet.create. - Import verification — AI tools frequently hallucinate React Native imports. This rule verifies that imported components and hooks actually exist in the installed version.
- No hardcoded secrets — Mobile apps are easily decompiled. Blocks API keys, Firebase configs, and tokens written directly in source files.