Files
ClaudeandMikael Finstad 5c90864e49 Adapt to the stage 2 rules of @mifi/lint-config
- Rules with more than 5 findings are turned off in .oxlintrc.json for now
  (listed with their counts, as a TODO)
- Safe autofixes for the rest (e.g. \u{..} escapes, `-x` instead of `-1 * x`,
  addEventListener options objects, Set#union, inlined destructuring, smaller
  type scopes, an https link)
- Disable comments with TODOs where a fix isn't clearly safe (and for the
  no-chained-comparison false positives)
- Remove the import/prefer-default-export disable comments (the rule is gone)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0172s5zURE6BsUjmqqVuK6Pt
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2026-10-28 07:23:54 +00:00

15 lines
954 B
TypeScript

// Collects `Changelog:` lines (see AGENTS.md) from commit messages since the last release tag, or since the ref given as argument.
// Usage: yarn release-notes [from-ref]
import { execa } from 'execa';
const from = process.argv[2] ?? (await execa('git', ['describe', '--tags', '--abbrev=0', '--match', 'v*'])).stdout.trim();
// Match anywhere in the message, not just git's trailer block (which is only the last paragraph)
const { stdout } = await execa('git', ['log', '--reverse', '--format=%B', `${from}..HEAD`]);
// without duplicates (e.g. the same line in several commits of a pull request)
// eslint-disable-next-line unicorn-js/prefer-iterator-to-array -- TODO fix (new rule in @mifi/lint-config)
const notes = [...new Set([...stdout.matchAll(/^changelog\s*:\s*(.+)$/gim)].map(([, note]) => note!.trim()))];
console.log(`Changes since ${from}:\n`);
console.log(notes.length > 0 ? notes.map((note) => `- ${note}`).join('\n') : '(none found)');