@orkestrel/guide 0.0.20 → 0.0.22

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.
@@ -917,6 +917,23 @@ function findMissingSymbols(symbols, source) {
917
917
  return findMissing(symbols.map(computeSymbolKey), source.map(computeSymbolKey));
918
918
  }
919
919
  /**
920
+ * Checks whether a source declares at least one behavioural member — a `class` or `interface`
921
+ * in its surface that carries a call-signature member — so a guide owes a `## Methods` group only
922
+ * where the source has one to document.
923
+ *
924
+ * @param source - The reflected source under parity
925
+ * @returns True if a surface `class` or `interface` declares a member; false otherwise
926
+ *
927
+ * @example
928
+ * ```ts
929
+ * hasBehaviouralSurface(createSource({ files: { 'src/types.ts': 'export interface Widget { render(): void }' }, module: 'src' })) // true
930
+ * hasBehaviouralSurface(createSource({ files: { 'src/constants.ts': 'export const NAMES = Object.freeze({})' }, module: 'src' })) // false
931
+ * ```
932
+ */
933
+ function hasBehaviouralSurface(source) {
934
+ return source.surface().some((symbol) => (symbol.keyword === "class" || symbol.keyword === "interface") && source.methods(symbol.name).length > 0);
935
+ }
936
+ /**
920
937
  * Finds the names in `names` that have no example — a fence containing the name at a
921
938
  * word boundary in `fences`, or a membership in `examples`, both count as
922
939
  * "has an example"; presence-only, fence and JSDoc content are never checked.
@@ -3332,7 +3349,7 @@ var Parity = class Parity {
3332
3349
  text: `${row.entry.spec} has no ## ${heading} section.`
3333
3350
  });
3334
3351
  }
3335
- if (row.guide.methods().length === 0) findings.push({
3352
+ if (row.guide.methods().length === 0 && hasBehaviouralSurface(row.source)) findings.push({
3336
3353
  spec: row.entry.spec,
3337
3354
  text: `${row.entry.spec} has no documented method groups.`
3338
3355
  });