Code review shouldn't catch import rules: a React Native architecture ESLint enforces A developer building the React Native app Bareship encoded its five-layer architecture as ESLint and dependency-cruiser rules rather than documentation, so that imports flow only app → features → entities → data → shared and features never import each other. Additional rules, each traced to a real bug, flag hard-coded strings, non-mirroring left/right styles that break right-to-left layouts, and calls the React Compiler caches; every error message explains the fix and links the underlying decision record. In a deliberately broken settings screen, the setup surfaced three lint errors plus a dependency-cruiser violation that no test would have caught. Short answer: Bareship writes its architecture down as lint errors instead of a wiki page. ESLint checks that imports go one way through five layers and that features never import each other, and dependency-cruiser checks the whole graph again in CI. Other rules each came from a real bug: hard-coded text, left / right styles that don't mirror in right-to-left languages, and calls the React Compiler caches. Every error message says how to fix it and links the decision behind it, so a teammate or an AI agent can fix the code without asking anyone. This is Part 3 of Building Bareship. Part 2 https://www.praveensingh.co.in/blog/bareship-offline-write-queue covered the offline queue and ended with a promise: an architecture the linter enforces. Every React Native project starts with folders and good intentions. Someone draws the layers on a whiteboard, everyone agrees, and it holds for a few weeks. Then a settings screen borrows a hook from the feed because it's quicker, a string skips translation because it's "temporary", and the person who knew the rules is on leave. Code review is supposed to catch this, but reviewers are looking at whether the feature works, not at import paths. So in Bareship the rules are errors. They show up in the editor while you type, block the commit, and fail CI. Here's a small screen I wrote to break the rules on purpose. It sits in the settings feature, shows how many pages of posts the feed has loaded, and adds a little margin: src/features/settings/screens/ProfileCard.tsx js import { View } from 'react-native'; import { StyleSheet } from 'react-native-unistyles'; import { useFeed } from '@/features/feed/api'; import { Text } from '@/shared/ui/primitives/Text'; export function ProfileCard { const feed = useFeed ; return