Skip to content

chore: add prettier as explicit devDependency and standardize usage#246

Merged
sjnims merged 2 commits intomainfrom
chore/225-add-prettier-devdep
Jan 18, 2026
Merged

chore: add prettier as explicit devDependency and standardize usage#246
sjnims merged 2 commits intomainfrom
chore/225-add-prettier-devdep

Conversation

@sjnims
Copy link
Copy Markdown
Owner

@sjnims sjnims commented Jan 18, 2026

Description

Add prettier@^3.4.2 as a devDependency and standardize how it's invoked across the project. This resolves the knip "unlisted binary" warning and aligns prettier usage with other tools like eslint and tsc.

Type of Change

  • Configuration change (changes to config.yaml, eslint, tsconfig, etc.)

Component(s) Affected

Other

  • Configuration files (config.yaml, eslint.config.js, tsconfig.json, etc.)
  • Documentation (CLAUDE.md, README.md)
  • GitHub templates/workflows (.github/)

Motivation and Context

knip's dead code analysis identified prettier as an "unlisted binary" - it was used in npm scripts and CI workflows but relied on npx to download it on-demand. This created:

  • Potential version inconsistencies across environments
  • Slower execution (npm registry lookup each time)
  • Inconsistency with how other tools are used

Fixes #225

How Has This Been Tested?

Test Configuration:

  • Node.js version: 25.2.1
  • OS: macOS (Darwin 25.1.0)

Test Steps:

  1. npm install - verified package-lock.json updates correctly
  2. npm run lint - passes
  3. npm run format:check - passes (now uses local prettier, expanded glob)
  4. npm run typecheck - passes
  5. npm test - all 1340 tests pass
  6. npx knip | grep prettier - no longer reports prettier as unlisted
  7. markdownlint CLAUDE.md CONTRIBUTING.md - passes
  8. uvx yamllint on all modified workflows - passes
  9. actionlint on all modified workflows - passes

Checklist

General

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors

Documentation

  • I have updated CLAUDE.md if behavior or commands changed
  • I have verified all links work correctly

Linting

  • I have run npm run lint and fixed all issues
  • I have run npm run format:check
  • I have run markdownlint "*.md" on Markdown files
  • I have run uvx yamllint -c .yamllint.yml on YAML files (if modified)
  • I have run actionlint on workflow files (if modified)

Testing

  • I have run npm test and all tests pass

Summary of Changes

File Change
package.json Add prettier@^3.4.2 to devDependencies; update format scripts to use prettier directly with expanded glob (*.json, *.md)
package-lock.json Updated with prettier dependency
.github/workflows/ci.yml Use npm run format:check instead of npx prettier
.github/workflows/ci-failure-analysis.yml Use npm run format in fix instructions
.github/workflows/claude-pr-review.yml Update formatting command and allowed tools pattern
.github/workflows/greet.yml Update checklist to reference npm run format:check
CLAUDE.md Update linting section to use npm run format:check
CONTRIBUTING.md Update both occurrences to use npm run format:check
.github/pull_request_template.md Update checklist item

Additional Notes

This approach matches how other tools are used in the project:

  • eslint is a devDependency, scripts use eslint directly
  • typescript is a devDependency, scripts use tsc directly
  • vitest is a devDependency, scripts use vitest directly

Now prettier follows the same pattern.


🤖 Generated with Claude Code

sjnims and others added 2 commits January 17, 2026 22:53
Add prettier@^3.4.2 as a devDependency to resolve knip warning about
unlisted binary. The package is used by format scripts in package.json
and CI workflows but was previously relying on npx auto-download.

Fixes #225

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update format scripts to use prettier directly (not npx)
- Expand format scope to include *.json and *.md files
- Update CI workflow to use npm run format:check
- Update ci-failure-analysis to use npm run format
- Update documentation to reference npm run format:check
- Update greet.yml and claude-pr-review.yml

This standardizes how prettier is invoked across the project,
matching the pattern used for other tools like eslint and tsc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sjnims sjnims self-assigned this Jan 18, 2026
@claude claude bot added chore Maintenance tasks (dependencies, CI, tooling) effort:small < 1 hour dependencies Pull requests that update a dependency file github-actions Pull requests that update GitHub Actions code documentation Improvements or additions to documentation labels Jan 18, 2026
@sjnims
Copy link
Copy Markdown
Owner Author

sjnims commented Jan 18, 2026

@claude Review this pull request for the cc-plugin-eval TypeScript evaluation framework.

        ## Context
        - Repository: ${{ github.repository }}
        - PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}
        - Author: ${{ github.event.pull_request.user.login }}
        - Base: ${{ github.event.pull_request.base.ref }}
        - Dependencies: Already installed (node_modules available)

        ## Instructions

        ### Step 1: Run Quality Checks
        Run these checks and note any failures:
        - `npm run typecheck` - TypeScript errors
        - `npm run lint` - ESLint issues
        - `npm run format:check` - Formatting

        ### Step 2: Review the Diff
        Run `gh pr diff ${{ github.event.pull_request.number }}` to see all changes.

        ### Step 3: Provide Feedback

        **For specific line-level issues**, use inline comments.
        Target issues like:
        - `any` types without justification
        - Missing `.js` extensions in imports (ESM requirement)
        - Zod schemas not updated when types change
        - Security concerns
        - Architecture violations (see criteria below)

        **For general observations**, post a summary comment.

        ## Review Criteria

        ### TypeScript Quality
        - No `any` types without justification
        - Proper error handling with typed errors
        - Imports use `.js` extension (ESM requirement)

        ### Architecture (4-Stage Pipeline)
        - **Stage 1 - Analysis** (`src/stages/1-analysis/`): Correct trigger extraction
        - **Stage 2 - Generation** (`src/stages/2-generation/`): LLM prompts well-structured
        - **Stage 3 - Execution** (`src/stages/3-execution/`): Proper Agent SDK usage
        - **Stage 4 - Evaluation** (`src/stages/4-evaluation/`): Programmatic detection preferred

        ### Code Patterns
        - Retry logic uses `src/utils/retry.ts`
        - Concurrency uses `src/utils/concurrency.ts`
        - Config validation uses Zod schemas
        - State management enables resume capability

        ### Testing
        - Tests added for new functionality
        - 80% coverage threshold maintained

        ## Output Format
        1. Post inline comments for specific issues found in the diff
        2. Post a summary comment with:
           - **Verdict**: ✅ Looks good / ⚠️ Needs changes / 🔍 Has concerns
           - **Quality Checks**: Results from typecheck, lint, format
           - **What's Good**: Positive aspects
           - **Suggestions**: General improvements (not covered by inline comments)

        Be constructive. Focus on significant issues, not nitpicks.

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Jan 18, 2026

Claude finished @sjnims's task in 1m 57s —— View job


Code Review Complete ✅

Reviewing PR #246: chore: add prettier as explicit devDependency and standardize usage

Tasks

  • Run quality checks (typecheck, lint, format)
  • Review PR diff
  • Analyze changes against review criteria
  • Provide feedback

Verdict: ✅ Looks Good

This PR successfully addresses issue #225 by adding prettier as an explicit devDependency and standardizing its usage across the project.

Quality Checks

TypeScript: No errors
ESLint: No errors
Prettier: All files properly formatted

What's Good

1. Problem-Solution Alignment

  • Directly resolves the knip "unlisted binary" warning
  • Eliminates version inconsistency and slow npx lookups
  • Establishes consistency with other tools (eslint, tsc, vitest)

2. Comprehensive Coverage

  • Updates all 9 relevant files: package.json, workflows, docs, and templates
  • Expands formatting scope to include *.json and *.md files (good enhancement!)
  • Updates both format and format:check scripts consistently

3. Workflow Updates

  • ci.yml: Uses npm run format:check for consistency
  • ci-failure-analysis.yml: Uses npm run format in fix instructions
  • claude-pr-review.yml: Updates both instructions AND allowed tools pattern (Bash(npx prettier:*)Bash(npm run format:*))
  • greet.yml: Updates contributor checklist

4. Documentation Consistency

  • CLAUDE.md: Updated in "Additional Linters" section
  • CONTRIBUTING.md: Updated in both linting and pre-commit sections
  • PR template: Simplified checklist item

5. Technical Quality

  • Proper semver range (^3.4.2) allows patch and minor updates
  • package-lock.json correctly installs prettier@3.8.0 (latest compatible version)
  • No breaking changes to existing workflows

Observations

Enhanced Scope (Positive)
The glob expansion from "src/**/*.ts" "tests/**/*.ts" to include "*.json" "*.md" is a good improvement that wasn't mentioned in the PR description. This ensures consistent formatting across all project files, not just TypeScript.

Minor Version Update
package-lock.json shows prettier@3.8.0 installed (latest in 3.x range), which is newer than the 3.4.2 specified in the PR description. This is expected behavior with ^3.4.2 and is correct.

Workflow Permissions
The claude-pr-review.yml update to allowed tools correctly changes the pattern to match the new script invocation. This shows attention to detail in ensuring Claude's review workflow continues to work properly.

Suggestions

None. This PR is well-executed and ready to merge.


Review Criteria Assessment

TypeScript Quality: ✅ N/A (configuration change only)
Architecture: ✅ N/A (no pipeline changes)
Code Patterns: ✅ Follows project conventions
Testing: ✅ All tests pass (per PR description: 1340 tests)


@sjnims sjnims merged commit f43135e into main Jan 18, 2026
17 of 18 checks passed
@sjnims sjnims deleted the chore/225-add-prettier-devdep branch January 18, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance tasks (dependencies, CI, tooling) dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation effort:small < 1 hour github-actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add prettier as explicit devDependency

1 participant