Skip to content

Add format() export and migrate to ESLint 9#98

Open
oalders wants to merge 5 commits intomainfrom
format
Open

Add format() export and migrate to ESLint 9#98
oalders wants to merge 5 commits intomainfrom
format

Conversation

@oalders
Copy link
Copy Markdown
Owner

@oalders oalders commented Apr 7, 2026

Summary

  • Add format(changes, options) export that returns formatted strings instead of printing to stdout, enabling programmatic use (e.g. in the upcoming auto-merge-dependabot GitHub Action)
  • print() now delegates to format() — fully backward compatible
  • Migrate from .eslintrc.json to eslint.config.js for ESLint 9 support

Test plan

  • npm test passes
  • npm run lint passes (was broken before due to missing flat config)
  • Verify CLI output is unchanged: ./bin/diff-lockfiles.js HEAD~1 HEAD

🤖 Generated with Claude Code

oalders and others added 2 commits April 7, 2026 03:01
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Refactor print functions to return strings via new format() export,
enabling programmatic use (e.g. in GitHub Actions). print() now
delegates to format() and remains backward compatible.

Replace .eslintrc.json with eslint.config.js for ESLint 9 support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
oalders and others added 2 commits April 7, 2026 04:04
- Add tests covering all format() output modes (json, text, markdown,
  table) plus edge cases (empty changes, title, default format)
- Fix print() to not emit blank line when changes are empty
- Document format() export in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@oalders
Copy link
Copy Markdown
Owner Author

oalders commented Apr 7, 2026

Code Review: PASSED ✅

Verdict: Production ready

What was reviewed

  • format() export addition (all 4 output modes return strings)
  • print() backward compatibility (delegates to format(), guards empty output)
  • ESLint 9 flat config migration
  • 9 tests covering all format modes, edge cases, and empty changes
  • CLAUDE.md documentation updates

Findings

No critical or important issues. All suggestions from the first review round have been addressed:

  • Added tests for format() (7 tests → 9 tests)
  • Fixed print() empty-changes blank line behavior
  • Updated CLAUDE.md to document format() export and test coverage

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant