pasika 0.10.68 → 0.10.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7819,7 +7819,7 @@ var typeExtractionRule = {
|
|
|
7819
7819
|
schema: [],
|
|
7820
7820
|
type: "problem",
|
|
7821
7821
|
docs: {
|
|
7822
|
-
description: "Require
|
|
7822
|
+
description: "Require unused type and schema exports to stay local, and independently consumed ones to be extracted."
|
|
7823
7823
|
}
|
|
7824
7824
|
},
|
|
7825
7825
|
create(context) {
|
|
@@ -7837,7 +7837,13 @@ var typeExtractionRule = {
|
|
|
7837
7837
|
for (const exp of module.exports) {
|
|
7838
7838
|
if (exp.kind !== "type" && exp.kind !== "schema") continue;
|
|
7839
7839
|
const consumers = [...index.symbolConsumers.get(symbolKey(file, exp.name)) ?? []];
|
|
7840
|
-
if (consumers.length === 0)
|
|
7840
|
+
if (consumers.length === 0) {
|
|
7841
|
+
findings.push({
|
|
7842
|
+
line: exp.line,
|
|
7843
|
+
message: `${exp.kind} "${exp.name}" has no external consumers; remove its export and keep it local. See docs/next-codebase-guide/rules/types-and-schemas-rule.md`
|
|
7844
|
+
});
|
|
7845
|
+
continue;
|
|
7846
|
+
}
|
|
7841
7847
|
if (componentExport) {
|
|
7842
7848
|
const componentConsumers = index.symbolConsumers.get(symbolKey(file, componentExport.name)) ?? /* @__PURE__ */ new Set();
|
|
7843
7849
|
const independent2 = consumers.filter((consumer) => !componentConsumers.has(consumer));
|