Skip to content

Comments

Moved to kebab-case formatting signup-form#5

Open
tomerqodo wants to merge 3 commits intocoderabbit_full_base_moved_to_kebab-case_formatting_signup-form_pr5from
coderabbit_full_head_moved_to_kebab-case_formatting_signup-form_pr5
Open

Moved to kebab-case formatting signup-form#5
tomerqodo wants to merge 3 commits intocoderabbit_full_base_moved_to_kebab-case_formatting_signup-form_pr5from
coderabbit_full_head_moved_to_kebab-case_formatting_signup-form_pr5

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#5

Summary by CodeRabbit

  • Bug Fixes

    • Email addresses are now trimmed of whitespace before submission.
  • Chores

    • Bumped version to 0.3.3.
    • Updated project configuration and linting standards.
  • Documentation

    • Added release workflow documentation to README, detailing patch, minor, and major release procedures.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

The pull request systematically converts filenames and import paths from PascalCase to kebab-case across the signup-form application, enforces this convention via a new ESLint rule, bumps the package version to 0.3.3, adds release workflow documentation, and includes minor functional refinements to email handling and loading state management.

Changes

Cohort / File(s) Summary
Kebab-case Filename Convention Migration
.storybook/preview.tsx, src/app.tsx, src/index.tsx, src/pages.tsx, src/preview.stories.tsx, src/components/frame.tsx, src/components/pages/form-page.tsx, src/components/pages/form-view.stories.ts, src/components/pages/form-view.tsx, src/components/pages/success-page.tsx, src/components/pages/success-view.stories.ts, src/components/pages/success-view.tsx, src/utils/helpers.tsx, src/utils/options.tsx
Updated all import paths from PascalCase to kebab-case filenames (e.g., AppContextapp-context, FormViewform-view) across the codebase with no functional impact on imports or exports. Also includes email trimming before submission in form-view.tsx, removal of setLoading(false) in form-page.tsx, and simplified return logic in helpers.tsx.
ESLint & Configuration
.eslintrc.cjs, ghost/core/core/shared/config/defaults.json
Added ghost/filenames/match-regex ESLint rule enforcing kebab-case-like filename pattern ^[a-z0-9.-]+$; fixed JSON formatting whitespace in defaults.json configuration.
Release & Documentation
README.md, package.json
Bumped version from 0.3.2 to 0.3.3; added comprehensive "Release" section documenting patch, minor, and major release workflows using yarn ship and requiring release commits to main, plus instructions for updating Ghost core's default.json.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐰 Filenames now kebab-cased with care,
AppContext dances as app-context fair,
ESLint enforces the naming we choose,
With emails trimmed, there's nothing to lose!
Version bumped up, release docs align—
The signup form pattern is now fine and fine! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: renaming files from PascalCase to kebab-case throughout the signup-form module, which is the primary focus of this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch coderabbit_full_head_moved_to_kebab-case_formatting_signup-form_pr5

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomerqodo
Copy link
Author

@coderabbitai review

1 similar comment
@tomerqodo
Copy link
Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/signup-form/src/components/pages/form-page.tsx (1)

27-30: ⚠️ Potential issue | 🟠 Major

Loading state never clears in minimal success path.

loading stays true, so the spinner remains and the “Email sent” state won’t appear. Please clear loading on success for the minimal flow.

Proposed fix
         if (minimal) {
             // Don't go to the success page, but show the success state in the form
+            setLoading(false);
             setSuccess(true);
         } else {
apps/signup-form/src/utils/helpers.tsx (1)

40-46: ⚠️ Potential issue | 🟠 Major

Avoid returning undefined when session history is missing.

getDefaultUrlHistory() can return undefined; the new unconditional return skips the fallback history and violates the URLHistory return type.

🛠️ Proposed fix
         if (window.location.host === new URL(siteUrl).host) {
             const history = getDefaultUrlHistory();
-            return history;
+            if (history) {
+                return history;
+            }
         }
🤖 Fix all issues with AI agents
In `@apps/signup-form/.eslintrc.cjs`:
- Around line 18-25: The ESLint rule is using the wrong namespace: replace the
incorrect rule key "ghost/filenames/match-regex" with "filenames/match-regex" so
ESLint finds the rule from eslint-plugin-filenames; keep the existing options
(the regex '^[a-z0-9.-]+$' and the third boolean argument false which
corresponds to ignoreExporting).

Comment on lines +18 to +25
// Sort multiple import lines into alphabetical groups
'ghost/sort-imports-es6-autofix/sort-imports-es6': ['error', {
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple']
}],

// suppress errors for missing 'import React' in JSX files, as we don't need it
// Enforce kebab-case (lowercase with hyphens) for all filenames
'ghost/filenames/match-regex': ['error', '^[a-z0-9.-]+$', false],

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

fd package.json -type f | head -20

Repository: agentic-review-benchmarks/Ghost-combined-coderabbit

Length of output: 265


🏁 Script executed:

find . -name "package.json" -path "*/apps/signup-form/*" -o -name "package.json" -path "*/package.json" | head -5

Repository: agentic-review-benchmarks/Ghost-combined-coderabbit

Length of output: 269


🏁 Script executed:

cat -n package.json | head -50

Repository: agentic-review-benchmarks/Ghost-combined-coderabbit

Length of output: 3699


🌐 Web query:

eslint-plugin-ghost filenames/match-regex rule documentation

💡 Result:

filenames/match-regex is not a rule from eslint-plugin-ghost; it comes from eslint-plugin-filenames. eslint-plugin-ghost is a shared config/plugin bundle, but this specific rule is documented in eslint-plugin-filenames’ README. [3]

eslint-plugin-filenames: filenames/match-regex

What it does: Enforces a filename convention using a regular expression (default convention is camelCase.js). [1]

Rule config:

  • Option 1: pattern (string regex)
  • Option 2: ignoreExporting (boolean) — when true, files with a named default export (per the plugin’s export-detection logic) are ignored by this rule. [1]

Example (snake_case filenames, ignore exporting files):

{
  "plugins": ["filenames"],
  "rules": {
    "filenames/match-regex": [2, "^[a-z_]+$", true]
  }
}

This would flag camelCase.js and allow snake_case.js. [1]

If you’re on ESLint v9 / using eslint-plugin-github

GitHub notes that filenames/match-regex was adapted into eslint-plugin-github as:

  • github/filenames-match-regex (same idea, different rule name) [2]

Example:

'github/filenames-match-regex': ['error', '^([a-z0-9]+)([A-Z][a-z0-9]+)*$']

[2]

Sources: [1] [2] [3]


🌐 Web query:

eslint-plugin-ghost NPM package rules

💡 Result:

eslint-plugin-ghost (v3.4.4) ships these custom ESLint rules (rule IDs are typically ghost/<rule-name>):

  • ghost-error-usage
  • ghost-tpl-usage
  • max-api-complexity
  • max-api-lines
  • no-native-error
  • node-assert-methods
  • node-assert-params
  • node-assert-strict [1]

The package’s entrypoint is lib/index.js and the canonical repo is TryGhost/eslint-plugin-ghost. [2]

To use the plugin in general, Ghost’s README shows enabling plugins: ['ghost'] and extending one of its shared configs via plugin:ghost/<config>. [3]


Fix the namespace prefix for the filenames rule.

The rule ghost/filenames/match-regex will fail because it uses an incorrect prefix. The filenames/match-regex rule comes from eslint-plugin-filenames, not eslint-plugin-ghost. Change it to filenames/match-regex instead. The third argument (boolean false) is valid—it sets the ignoreExporting option—but won't matter if the rule isn't found.

🤖 Prompt for AI Agents
In `@apps/signup-form/.eslintrc.cjs` around lines 18 - 25, The ESLint rule is
using the wrong namespace: replace the incorrect rule key
"ghost/filenames/match-regex" with "filenames/match-regex" so ESLint finds the
rule from eslint-plugin-filenames; keep the existing options (the regex
'^[a-z0-9.-]+$' and the third boolean argument false which corresponds to
ignoreExporting).

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.

2 participants