Code review shouldn't catch import rules: a React Native architecture ESLint enforces
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…
Bareship enforces its architecture as lint errors using ESLint and dependency-cruiser. ESLint checks import directions through five layers, while dependency-cruiser examines the entire import graph in CI. Each rule originates from a real bug, such as hard-coded text, inconsistent text alignment, and React Compiler caches. Every error message provides a solution and explains the reasoning behind it, enabling teammates or AI agents to fix the code without seeking assistance.
This architecture enforcement is the main focus of this article, which is the third part of Bareship's building process.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.