ShtukbaseStandard
archivo del paquete→ .shtukbase/packages/std-keep-a-changelog/checks/cl04_links.ts

checks/cl04_links.ts

13 líneas, 662 B.

El archivo tal como está en el paquete: el código y sus comentarios no se traducen.

  1. // CL-R04: every release heading has a link reference (`[1.2.0]: https://…compare/v1.1.0...v1.2.0`), Unreleased too.
  2. import { config, logs, PKG } from './kaclib.ts';
  3. import { finish, norm } from './lib/std.ts';
  4. const n = norm(PKG, 'CL-R04', 'observe');
  5. const out: string[] = [];
  6. if (n.active)
  7. for (const l of logs(config()).logs)
  8. for (const r of l.releases) {
  9. const key = r.unreleased ? 'unreleased' : (r.version ?? '').toLowerCase();
  10. if (!l.links.has(key)) out.push(`${l.file}:${r.line}: "${r.unreleased ? 'Unreleased' : r.version}" has no reference link "[${r.unreleased ? 'unreleased' : r.version}]: compare URL"`);
  11. }
  12. finish(n, out);