chore(config): frente D — ESLint boundaries + Husky + commitlint + gitleaks
Higiene de PR antes da primeira feature de domínio. - Tags Nx canônicas (scope/type/domain) em todos os 5 projetos, incluindo e2e - depConstraints ESLint: scope:api|web|shared + type:app|e2e|feature|util|data - Husky 9 + lint-staged: eslint --max-warnings=0 + prettier --check em pre-commit - commitlint @conventional: tipo obrigatório, scope enum warn, body ilimitado - gitleaks via Docker: zero leaks no tree completo; allowlist .agents/,.claude/,tmp/ - tmp/ adicionado ao .gitignore (relatórios de scan locais) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,10 +21,33 @@ export default [
|
||||
enforceBuildableLibDependency: true,
|
||||
allow: ['^.*/eslint(\\.base)?\\.config\\.[cm]?[jt]s$'],
|
||||
depConstraints: [
|
||||
// ── scope ────────────────────────────────────────────────────────
|
||||
// api só usa libs api ou shared; web só usa libs web ou shared
|
||||
{ sourceTag: 'scope:api', onlyDependOnLibsWithTags: ['scope:api', 'scope:shared'] },
|
||||
{ sourceTag: 'scope:web', onlyDependOnLibsWithTags: ['scope:web', 'scope:shared'] },
|
||||
// shared não pode importar código de app-scope
|
||||
{ sourceTag: 'scope:shared', onlyDependOnLibsWithTags: ['scope:shared'] },
|
||||
|
||||
// ── type ─────────────────────────────────────────────────────────
|
||||
// apps só dependem de libs (feature/util/data), nunca de outro app
|
||||
{
|
||||
sourceTag: '*',
|
||||
onlyDependOnLibsWithTags: ['*'],
|
||||
sourceTag: 'type:app',
|
||||
onlyDependOnLibsWithTags: ['type:feature', 'type:util', 'type:data'],
|
||||
},
|
||||
// e2e depende do seu app-par e de utils; nunca de outro app
|
||||
{
|
||||
sourceTag: 'type:e2e',
|
||||
onlyDependOnLibsWithTags: ['type:app', 'type:util'],
|
||||
},
|
||||
// features dependem de features, utils e dados — não de apps
|
||||
{
|
||||
sourceTag: 'type:feature',
|
||||
onlyDependOnLibsWithTags: ['type:feature', 'type:util', 'type:data'],
|
||||
},
|
||||
// utils são folha — não importam features nem apps
|
||||
{ sourceTag: 'type:util', onlyDependOnLibsWithTags: ['type:util', 'type:data'] },
|
||||
// data é camada mais baixa — só pode depender de outra camada data
|
||||
{ sourceTag: 'type:data', onlyDependOnLibsWithTags: ['type:data'] },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user