Fix file formatting with Prettier#9
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Free 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughA comprehensive formatting and code style refactoring across cli, core, and usc packages standardizing multi-line constructs and whitespace for consistency. Includes one functional enhancement: explicit chapter identifier tracking in converter's dry-run metadata collection path. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
This PR applies Prettier-driven formatting updates across the monorepo to improve readability and consistency, without changing behavior in the core AST/markdown pipeline, USC conversion/downloading logic, or CLI commands.
Changes:
- Reformats long type unions, function signatures, and complex conditionals/chains for readability in
@law2md/coreand@law2md/usc. - Normalizes formatting in CLI command definitions and UI helper functions.
- Simplifies a few multi-line exports/object literals into more compact forms where they fit within the configured print width.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/usc/src/index.ts | Reformats type re-exports into a multi-line export block. |
| packages/usc/src/downloader.ts | Splits a long helper function signature across multiple lines. |
| packages/usc/src/converter.ts | Reflows ternaries, object types, chained string ops, and predicates for readability. |
| packages/usc/src/converter.test.ts | Compacts a filter+map chain into a single line. |
| packages/core/src/markdown/renderer.ts | Splits renderSection signature; compacts a small Set initialization. |
| packages/core/src/markdown/renderer.test.ts | Reflows test AST literals (including quote minimization in a string). |
| packages/core/src/markdown/links.test.ts | Compacts register and expect(...).toBe(...) calls to single lines. |
| packages/core/src/markdown/frontmatter.test.ts | Normalizes string quoting consistent with Prettier configuration. |
| packages/core/src/index.ts | Compacts AST constant exports; removes trailing blank line. |
| packages/core/src/ast/types.ts | Reformats a long string-literal union type across multiple lines. |
| packages/core/src/ast/types.test.ts | Reflows inline object literals into multi-line objects. |
| packages/core/src/ast/builder.ts | Reflows unions/conditionals/object literals to match Prettier formatting. |
| packages/core/src/ast/builder.test.ts | Splits helper signature and reflows complex expressions/calls. |
| packages/cli/src/ui.ts | Compacts a function signature onto one line within print width. |
| packages/cli/src/commands/download.ts | Compacts simple ternaries into single-line expressions. |
| packages/cli/src/commands/convert.ts | Splits a helper signature; compacts a .option(...) and console.error(...) call. |
This pull request primarily refactors code formatting across several files, improving readability and consistency by splitting long lines and formatting complex expressions. No functional changes or new features are introduced; all modifications are focused on code style and maintainability.
Code formatting and readability improvements:
packages/core/src/ast/builder.ts,packages/core/src/ast/builder.test.ts, andpackages/core/src/ast/types.ts. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]packages/cli/src/commands/convert.ts,packages/cli/src/commands/download.ts,packages/cli/src/ui.ts, and related test files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]packages/core/src/index.ts. [1] [2]Summary by CodeRabbit
Refactor
Bug Fixes