Adds the `conformance/pii-declaration-must-be-complete` ESLint rule at
warn severity. The rule detects `custom: { pii: { ... } }` blocks in
Payload config files and warns when any of the four required sub-fields
(`category`, `purpose`, `exportable`, `restrictable`) is missing.
Incomplete PII declarations can produce incorrect audit reports —
sub-second editor feedback catches the gap before it reaches
compliance/data-map.yml.
- Rule + 7 RuleTester fixtures (complete passes, each missing field
warns, non-pii custom block is no-op, malformed custom.pii is no-op)
- Registered in plugin.js + base.js at "warn"
- Conformance rule count bumped 7 → 8 in CLAUDE.md +
conformance-quickref.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
2.1 KiB
JavaScript
44 lines
2.1 KiB
JavaScript
import featureMustHaveManifest from "./rules/feature-must-have-manifest.js";
|
|
import usecaseMustHaveTestFile from "./rules/usecase-must-have-test-file.js";
|
|
import requiredCoresInstalled from "./rules/required-cores-installed.js";
|
|
import noUndeclaredEventPublish from "./rules/no-undeclared-event-publish.js";
|
|
import noUndeclaredAudit from "./rules/no-undeclared-audit.js";
|
|
import noUndeclaredAnalyticsEvent from "./rules/no-undeclared-analytics-event.js";
|
|
import usecaseMustBeWired from "./rules/usecase-must-be-wired.js";
|
|
import componentMustHaveStory from "./rules/component-must-have-story.js";
|
|
import componentMustHaveTest from "./rules/component-must-have-test.js";
|
|
import atomicTierImportDirection from "./rules/atomic-tier-import-direction.js";
|
|
import piiDeclarationMustBeComplete from "./rules/pii-declaration-must-be-complete.js";
|
|
|
|
/**
|
|
* The `@repo/core-eslint` conformance plugin. Aggregates custom rules that
|
|
* enforce feature-conformance contracts (manifest presence, sibling tests,
|
|
* required-cores ↔ workspace consistency).
|
|
*
|
|
* Registered as the `conformance` plugin in flat config:
|
|
*
|
|
* import conformancePlugin from "@repo/core-eslint/plugin";
|
|
* export default [
|
|
* { plugins: { conformance: conformancePlugin } },
|
|
* { rules: { "conformance/feature-must-have-manifest": ["warn", { repoRoot: import.meta.dirname }] } },
|
|
* ];
|
|
*/
|
|
const plugin = {
|
|
meta: { name: "conformance", version: "0.3.0" },
|
|
rules: {
|
|
"feature-must-have-manifest": featureMustHaveManifest,
|
|
"usecase-must-have-test-file": usecaseMustHaveTestFile,
|
|
"required-cores-installed": requiredCoresInstalled,
|
|
"no-undeclared-event-publish": noUndeclaredEventPublish,
|
|
"no-undeclared-audit": noUndeclaredAudit,
|
|
"no-undeclared-analytics-event": noUndeclaredAnalyticsEvent,
|
|
"usecase-must-be-wired": usecaseMustBeWired,
|
|
"component-must-have-story": componentMustHaveStory,
|
|
"component-must-have-test": componentMustHaveTest,
|
|
"atomic-tier-import-direction": atomicTierImportDirection,
|
|
"pii-declaration-must-be-complete": piiDeclarationMustBeComplete,
|
|
},
|
|
};
|
|
|
|
export default plugin;
|