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>
71 lines
2.6 KiB
JavaScript
71 lines
2.6 KiB
JavaScript
import nx from '@nx/eslint-plugin';
|
|
|
|
export default [
|
|
...nx.configs['flat/base'],
|
|
...nx.configs['flat/typescript'],
|
|
...nx.configs['flat/javascript'],
|
|
{
|
|
ignores: [
|
|
'**/dist',
|
|
'**/out-tsc',
|
|
'**/vite.config.*.timestamp*',
|
|
'**/vitest.config.*.timestamp*',
|
|
],
|
|
},
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
|
rules: {
|
|
'@nx/enforce-module-boundaries': [
|
|
'error',
|
|
{
|
|
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: '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'] },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
'**/*.ts',
|
|
'**/*.tsx',
|
|
'**/*.cts',
|
|
'**/*.mts',
|
|
'**/*.js',
|
|
'**/*.jsx',
|
|
'**/*.cjs',
|
|
'**/*.mjs',
|
|
],
|
|
// Override or add rules here
|
|
rules: {},
|
|
},
|
|
];
|