feat(cli): interactive Ultracite linter selection in verno create#2
Conversation
Verno asks for biome, eslint, or oxlint when the ultracite add-on is enabled and --linter is not set, then passes --linter to ultracite init. This avoids relying on Ultracite skipping linter selection when --pm is set.
Document interactive wizard behavior, CLI --linter help, and manifest field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ResolvedCreateInputs from the wizard now always carries ultraciteLinter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…EADME Avoid implying interactive ultracite init always prompts for linter; point to verno create --linter and manual ultracite init. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughInteractive Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant VernoCLI as Verno CLI (wizard)
participant Ultracite as Ultracite init
User->>VernoCLI: run "verno create" (interactive)
VernoCLI->>VernoCLI: check if ultracite enabled & --linter provided
alt --linter not provided
VernoCLI->>User: prompt for linter (DEFAULT_ULTRACITE_LINTER preselected)
User->>VernoCLI: select linter
end
VernoCLI->>Ultracite: run "ultracite init --linter <selected>"
Ultracite-->>User: interactive initialization continues
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cli/src/commands/create.ts (1)
186-193: Enforce the “linter must be resolved” invariant before interactive Ultracite run.
At Line 187, silently allowingundefinedcan hide regressions and re-open implicit-linter behavior. Prefer failing fast (or defaulting explicitly) in this branch.♻️ Suggested tightening
- const prefix = - resolved.ultraciteLinter === undefined ? "" : `Linter: ${resolved.ultraciteLinter}. `; + if (resolved.ultraciteLinter === undefined) { + throw new CLIError("Internal error: ultracite linter must be resolved for interactive runs.", { + code: "VALIDATION", + }); + } + const prefix = `Linter: ${resolved.ultraciteLinter}. `; process.stdout.write( `\n${pc.cyan("ultracite")} — ${prefix}Continue in Ultracite for frameworks, editors, and hooks.\n\n`, ); await runUltraciteIfEnabled(true, resolved.packageManager, projectDir, "interactive", { ciSafe: false, linter: resolved.ultraciteLinter, });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/cli/src/commands/create.ts` around lines 186 - 193, The code currently allows resolved.ultraciteLinter to be undefined before calling runUltraciteIfEnabled, which hides regressions; update the create command to enforce that resolved.ultraciteLinter is resolved before launching the interactive Ultracite run (the prefix calculation and the runUltraciteIfEnabled(...) call). Specifically, check resolved.ultraciteLinter and either throw a clear error (fail-fast) or explicitly assign a default value before computing prefix and calling runUltraciteIfEnabled, and ensure the error/assignment references resolved.ultraciteLinter so the invariant is explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/cli/src/commands/create.ts`:
- Around line 186-193: The code currently allows resolved.ultraciteLinter to be
undefined before calling runUltraciteIfEnabled, which hides regressions; update
the create command to enforce that resolved.ultraciteLinter is resolved before
launching the interactive Ultracite run (the prefix calculation and the
runUltraciteIfEnabled(...) call). Specifically, check resolved.ultraciteLinter
and either throw a clear error (fail-fast) or explicitly assign a default value
before computing prefix and calling runUltraciteIfEnabled, and ensure the
error/assignment references resolved.ultraciteLinter so the invariant is
explicit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c6c3fec2-d0bb-4173-8f04-c1f4b38dfab7
📒 Files selected for processing (9)
packages/cli/README.mdpackages/cli/__tests__/create-plan.test.tspackages/cli/src/commands/create-actions.tspackages/cli/src/commands/create-args.tspackages/cli/src/commands/create-prompts.tspackages/cli/src/commands/create.tspackages/cli/src/index.tspackages/template-generator/src/templates.generated.tspackages/template-generator/templates/shared/README.md.hbs
Fail fast with CLIError when the ultracite add-on runs without a linter preset. Consolidate quiet and interactive paths under one resolved linter. Co-Authored-By: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Problem
Interactive
verno createwith the Ultracite add-on runsultracite initwith--pm. Ultracite treats that as a non-interactive signal and skips the linter prompt, defaulting to Biome. Users who expected to pick Oxlint or ESLint never saw a linter step, while Verno’s copy suggested they would choose the stack in Ultracite.Root cause
Ultracite’s init flow does not prompt for a linter when
--pmis set without--linter; tooling like Verno always passes--pmto pin the package manager.Result
--linteris not passed on the CLI.ultracite init --linter <id>so the choice is explicit and CI/non-interactive (-y) behavior is unchanged (still defaults tooxlintwhen--linteris omitted).Made with Cursor
Summary by CodeRabbit
New Features
Documentation
Tests