Your codebase's night watch.
Intercepts every commit before it lands. Runs your linting rules, formatting checks, and custom policies in milliseconds. No bad code gets past the gate.
Define architectural boundaries. Enforce import rules, naming conventions, and module dependencies. Your codebase, your laws.
When violations are found, localcop doesn't just report — it fixes. Automated formatting, import sorting, and style corrections applied instantly.
Works out of the box with sensible defaults. One command to install, one file to customize. Complexity is optional; protection is immediate.
// localcop.config.ts
import { defineConfig } from 'localcop';
export default defineConfig({
rules: {
'no-circular-imports': 'error',
'enforce-barrel-exports': 'warn',
'max-file-length': ['error', { max: 300 }],
'naming-convention': ['error', {
components: 'PascalCase',
hooks: 'camelCase',
constants: 'UPPER_SNAKE'
}]
},
patrol: {
preCommit: true,
autoFix: true,
reportFormat: 'compact'
}
});