🎯 Use a Preset
Recommended for most projects
Get started with proven architecture patterns:
- Hexagonal (Ports & Adapters)
- Layered (N-tier)
- Clean Architecture
- Next.js / NestJS specific
Get Stricture running in your project in minutes.
Before installing Stricture, ensure your project has:
Optional (recommended for better path resolution):
tsconfig.jsonStricture supports two workflows:
🎯 Use a Preset
Recommended for most projects
Get started with proven architecture patterns:
🔧 Custom Architecture
For unique patterns
Define your own boundaries and rules for:
The fastest way to get started:
npm install -D @stricture/eslint-pluginAdd Stricture to your existing ESLint config:
import stricture from '@stricture/eslint-plugin'
export default [ { // Your existing ESLint config files: ['**/*.ts', '**/*.tsx'], plugins: { /* your other plugins */ }, rules: { /* your other rules */ } }, stricture.configs.hexagonal() // Add Stricture]Run ESLint to verify Stricture is working:
npx eslint .If you have architecture violations, you’ll see errors like:
src/domain/user.ts 5:1 error Import from 'infrastructure' to 'domain' is not allowed Domain cannot depend on infrastructure @stricture/enforce-boundaries✅ Stricture is now enforcing your architecture!
Let Stricture set everything up automatically:
npx stricture initThe CLI will:
View full CLI documentation →
Need to add ignore patterns or custom rules? Pass options to the config:
import stricture from '@stricture/eslint-plugin'
export default [ stricture.configs.hexagonal({ ignorePatterns: ['**/*.test.ts', 'src/legacy/**'], rules: [ { id: 'no-legacy-imports', from: { pattern: 'src/**' }, to: { pattern: 'src/legacy/**' }, allowed: false, message: 'No new code should depend on legacy modules' } ] })]For complex configurations with many custom rules, you can use a separate config file:
import stricture from '@stricture/eslint-plugin'
export default [ { // Your existing ESLint config files: ['**/*.ts', '**/*.tsx'], plugins: { /* your other plugins */ }, rules: { /* your other rules */ } }, stricture.configs.recommended() // Reads .stricture/config.json]{ "preset": "@stricture/hexagonal", "boundaries": [ /* many boundaries */ ], "rules": [ /* many rules */ ]}Learn more in the Configuration Files Guide.
ESLint violations appear inline with the ESLint extension:
ESLint integration is built-in:
If your project uses TypeScript path aliases, Stricture automatically resolves them using your tsconfig.json:
{ "compilerOptions": { "baseUrl": ".", "paths": { "@/domain/*": ["src/domain/*"], "@/infrastructure/*": ["src/infrastructure/*"] } }}No additional configuration needed.
For monorepos, configure Stricture per-package:
my-monorepo/├── packages/│ ├── api/│ │ ├── eslint.config.js # stricture.configs.hexagonal()│ │ └── package.json│ ├── web/│ │ ├── eslint.config.js # stricture.configs.nextjs()│ │ └── package.json│ └── shared/│ └── package.json└── package.jsonEach package can use a different preset. See the Monorepos Guide for details.
Solution:
stricture.configs.xxx()@stricture/eslint-plugin is installednpx eslint --debug . to see detailed outputSolution:
tsconfig.json is in your project rootbaseUrl and paths are configured correctlyFor more troubleshooting help, see the Troubleshooting Guide.
Quick Start Tutorial
Build a working example in 5 minutes.
Core Concepts
Learn how boundaries and rules work.
ESLint Setup
Advanced ESLint configuration options.
Browse Presets
Explore all architecture patterns.