Adopt dependency-cruiser as the single declarative source for bounded-context + atomic-layer boundaries, replacing the per-context no-restricted-imports blocks that had to be hand-copied (and had left herregistratie uncovered). `.dependency-cruiser.js` encodes context direction (everyone→shared, herregistratie→registratie, showcase→*), domain-purity, contracts-import-nothing, ui↛infrastructure, ApiClient confinement, and no-circular. `npm run dep:check` enforces (wired into ci-local.sh + the frontend CI job); `npm run dep:graph` emits a committed mermaid context×layer graph. ESLint slimmed to no-explicit-any + template a11y. Docs + new-context skill updated to the single source. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
54 lines
2.3 KiB
JavaScript
54 lines
2.3 KiB
JavaScript
import tseslint from 'typescript-eslint';
|
|
import angular from 'angular-eslint';
|
|
|
|
/**
|
|
* ESLint now owns only the rules that are NOT dependency-graph shaped: no `any`, and
|
|
* template accessibility. The architecture's **boundary** rules — bounded-context
|
|
* direction (herregistratie → registratie → shared, auth/brief/beheer → shared; shared
|
|
* depends on nothing), `domain/` framework-freedom, `contracts/` purity, `ui ↛
|
|
* infrastructure`, and ApiClient confinement — moved to **dependency-cruiser** (WP-38,
|
|
* `.dependency-cruiser.js`): one declarative source that also emits the architecture graph
|
|
* (`npm run dep:graph`) and is enforced by `npm run dep:check` (in CI). That replaced the
|
|
* per-context `no-restricted-imports` blocks that had to be hand-copied (and had left
|
|
* `herregistratie` uncovered).
|
|
*/
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'dist/**',
|
|
'node_modules/**',
|
|
'storybook-static/**',
|
|
'.angular/**',
|
|
'coverage/**',
|
|
'backend/**',
|
|
// Generated client — owns its own /* eslint-disable */ header.
|
|
'src/app/shared/infrastructure/api-client.ts',
|
|
],
|
|
},
|
|
{
|
|
files: ['src/**/*.ts'],
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
|
|
},
|
|
plugins: { '@typescript-eslint': tseslint.plugin },
|
|
rules: { '@typescript-eslint/no-explicit-any': 'error' },
|
|
// This repo has no .html files — every template is inline. This processor
|
|
// extracts each component's template string into a virtual `*.html` file,
|
|
// which the template-a11y block below (`files: ['src/**/*.html']`) then lints.
|
|
processor: angular.processInlineTemplates,
|
|
},
|
|
|
|
// Template a11y (WP-17): the official angular-eslint accessibility bundle
|
|
// (alt-text, label-has-associated-control, click/mouse-events-have-key-events,
|
|
// interactive-supports-focus, valid-aria, no-autofocus, and more) linting the
|
|
// virtual `.html` files the processor above extracts from inline templates.
|
|
...angular.configs.templateAccessibility.map((c) => ({ ...c, files: ['src/**/*.html'] })),
|
|
|
|
// Tests legitimately use `any` to feed invalid messages/states into reducers.
|
|
{
|
|
files: ['src/**/*.spec.ts'],
|
|
rules: { '@typescript-eslint/no-explicit-any': 'off' },
|
|
},
|
|
];
|