feat(core-eslint): add entity-must-have-test and no-relative-parent-import rules

Two CLAUDE.md conventions had no mechanical gate, so both drifted:
entity models shipped without sibling tests, and feature test files
imported src modules via `../` instead of the `@/` alias.

- `entity-must-have-test` — every entities/models/<x>.ts needs a sibling
  <x>.test.ts (errors and barrels excluded).
- `no-relative-parent-import-in-tests` — feature test files must import
  src via `@/`, not `../`. Scoped to feature packages; core packages are
  governed by their own generator templates.

Both register at warn level, bringing the conformance rule count to 15.
This commit is contained in:
2026-05-21 11:49:45 +02:00
parent c099d7182b
commit d3944f40db
7 changed files with 260 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ import atomicTierImportDirection from "./rules/atomic-tier-import-direction.js";
import piiDeclarationMustBeComplete from "./rules/pii-declaration-must-be-complete.js";
import noUndeclaredConsentCheck from "./rules/no-undeclared-consent-check.js";
import noUndeclaredRateLimit from "./rules/no-undeclared-rate-limit.js";
import entityMustHaveTest from "./rules/entity-must-have-test.js";
import noRelativeParentImportInTests from "./rules/no-relative-parent-import-in-tests.js";
/**
* The `@repo/core-eslint` conformance plugin. Aggregates custom rules that
@@ -26,7 +28,7 @@ import noUndeclaredRateLimit from "./rules/no-undeclared-rate-limit.js";
* ];
*/
const plugin = {
meta: { name: "conformance", version: "0.3.0" },
meta: { name: "conformance", version: "0.4.0" },
rules: {
"feature-must-have-manifest": featureMustHaveManifest,
"usecase-must-have-test-file": usecaseMustHaveTestFile,
@@ -41,6 +43,8 @@ const plugin = {
"pii-declaration-must-be-complete": piiDeclarationMustBeComplete,
"no-undeclared-consent-check": noUndeclaredConsentCheck,
"no-undeclared-rate-limit": noUndeclaredRateLimit,
"entity-must-have-test": entityMustHaveTest,
"no-relative-parent-import-in-tests": noRelativeParentImportInTests,
},
};