fix(core-eslint): fail loudly on unparseable manifest in wiring gate
usecase-must-be-wired returned {} when the manifest parsed to null,
silently disabling the error-level gate when the manifest existed but
could not be read. It now reports unparseableManifest on Program in
that case; a genuinely missing manifest stays a no-op (that is
feature-must-have-manifest's job).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -153,6 +153,35 @@ describe("usecase-must-be-wired", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("reports unparseableManifest when the manifest exists but cannot be parsed", () => {
|
||||
const { repoRoot, binderFile } = makeFixture({
|
||||
manifestUseCases: {},
|
||||
binderBody: `export function bindProductionDemo(ctx) {}`,
|
||||
});
|
||||
// Overwrite the manifest with a shape the AST walker cannot read
|
||||
// (no defineFeature call) — the gate must fail loudly, not no-op.
|
||||
fs.writeFileSync(
|
||||
path.join(repoRoot, "packages", "demo", "src", "feature.manifest.ts"),
|
||||
`export const demoManifest = { name: "demo" };`,
|
||||
);
|
||||
tester.run("usecase-must-be-wired", rule, {
|
||||
valid: [],
|
||||
invalid: [
|
||||
{
|
||||
filename: binderFile,
|
||||
code: fs.readFileSync(binderFile, "utf8"),
|
||||
options: [{ repoRoot }],
|
||||
errors: [
|
||||
{
|
||||
messageId: "unparseableManifest",
|
||||
data: { feature: "demo" },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it("is a no-op when the feature manifest declares no use cases", () => {
|
||||
const { repoRoot, binderFile } = makeFixture({
|
||||
manifestUseCases: {},
|
||||
|
||||
Reference in New Issue
Block a user