Moved to kebab-case formatting signup-form#5
Conversation
- renamed files to kebab-case Changelog for v0.3.2 -> 0.3.3:
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
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 | 🟠 MajorLoading state never clears in minimal success path.
loadingstaystrue, 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 | 🟠 MajorAvoid returning
undefinedwhen session history is missing.
getDefaultUrlHistory()can returnundefined; the new unconditional return skips the fallback history and violates theURLHistoryreturn 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).
| // 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], | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
fd package.json -type f | head -20Repository: 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 -5Repository: agentic-review-benchmarks/Ghost-combined-coderabbit
Length of output: 269
🏁 Script executed:
cat -n package.json | head -50Repository: 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) — whentrue, 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-usageghost-tpl-usagemax-api-complexitymax-api-linesno-native-errornode-assert-methodsnode-assert-paramsnode-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).
Benchmark PR from agentic-review-benchmarks#5
Summary by CodeRabbit
Bug Fixes
Chores
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.