@cativi/scaffold-guard
v1.0.1
Published
Scaffold code that passes your lint rules by default
Maintainers
Readme
ScaffoldGuard
Code that passes lint by default.
Stop scaffolding code that immediately fails your linter. ScaffoldGuard generates TypeScript code that's already compliant with your conventions.
The Problem
# You scaffold a component
ng generate component user-card
# You run lint
ng lint
# → 47 errors in user-card.component.ts
# → "don't use any", "missing types", etc.Sound familiar?
The Solution
sg scaffold react-component UserCard
sg lint src/
# → ✓ No convention violationsEvery scaffolded file is guaranteed to pass lint. No cleanup needed.
Install
npm install -g scaffold-guardUsage
sg scaffold <type> <name>
# Examples:
sg scaffold react-component UserCard
sg scaffold react-hook useAuth
sg scaffold angular-component UserProfile
sg scaffold node-controller userLint Your Code
sg lint src/Checks for:
console.logusage- Loose equality (
==instead of===) anytypes- Deep relative imports (
../../)
Configure
Create sg.config.json in your project root:
{
"rules": {
"noConsole": true,
"strictEquality": true,
"noAny": true
},
"templates": {
"prefix": "app",
"outputDir": "src"
}
}Why?
- Onboarding: New devs get compliant code from day one
- Consistency: Team follows the same patterns
- Speed: No lint cleanup after scaffolding
- Ownership: Your rules, your conventions
