Skip to content

Comments

Moved to kebab-case formatting - core - frontend#25785

Merged
ibalosh merged 2 commits intomainfrom
moved-to-kebab-case-core-frontend
Jan 7, 2026
Merged

Moved to kebab-case formatting - core - frontend#25785
ibalosh merged 2 commits intomainfrom
moved-to-kebab-case-core-frontend

Conversation

@ibalosh
Copy link
Contributor

@ibalosh ibalosh commented Jan 6, 2026

ref https://linear.app/ghost/issue/NY-882/migrate-ghost-codebase-to-kebab-case-file-naming-convention-core

  • Renamed all files to match to kebab-case format
  • Added ESLint kebab-case rule

@cursor
Copy link

cursor bot commented Jan 6, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Adds two ESLint overrides in ghost/core/.eslintrc.js: one for core/frontend/**/*.js (disables ghost/filenames/match-exported-class and enforces ghost/filenames/match-regex with ^[a-z0-9.-]+$) and one for frontend helper paths (disables the filename regex for helpers). Updates numerous frontend source and test files to require/import lowercase kebab-case filenames (e.g., ParentRouterparent-router, Minifierminifier, SiteMapManagersite-map-manager, etc.). Adjusts JSDoc type import references accordingly. No runtime logic, API signatures, or exported entity definitions were changed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: migrating core frontend files to kebab-case formatting, which aligns with the extensive file renaming throughout the changeset.
Description check ✅ Passed The description is directly related to the changeset, referencing the linear issue, mentioning file renaming to kebab-case format, and noting the addition of ESLint rules—all of which match the changes shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@ibalosh ibalosh changed the title WIP: moved to kebab case Moved to kebab-case formatting - core - frontend Jan 6, 2026
@ibalosh ibalosh force-pushed the moved-to-kebab-case-core-frontend branch 3 times, most recently from cf83845 to 39bfa7d Compare January 6, 2026 14:42
@ibalosh ibalosh requested review from 9larsons and cmraible January 6, 2026 14:42
@ibalosh ibalosh force-pushed the moved-to-kebab-case-core-frontend branch from 39bfa7d to 271042e Compare January 7, 2026 11:00
@ibalosh ibalosh force-pushed the moved-to-kebab-case-core-frontend branch from 271042e to 8e7b834 Compare January 7, 2026 11:09
Copy link
Contributor

@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: 0

🧹 Nitpick comments (2)
ghost/core/.eslintrc.js (2)

112-119: Good approach with clear rationale.

The comment effectively explains why helper filenames are exempt from kebab-case rules—they map directly to Handlebars helper names used in themes, making this a backwards-compatibility requirement.

Minor cleanup opportunity: Since the rule is disabled ('off'), the pattern and subsequent parameters on line 117 are unused. Consider simplifying to just 'ghost/filenames/match-regex': 'off' for clarity.


104-110: Consider a stricter kebab-case regex pattern.

The current pattern '^[a-z0-9.-]+$' permits malformed filenames such as --file, file..name, -start, or .hidden. A more restrictive pattern would enforce proper kebab-case structure while still allowing dots for test/spec suffixes.

♻️ Suggested stricter pattern
             files: ['core/frontend/**/*.js'],
             rules: {
                 'ghost/filenames/match-exported-class': 'off',
-                'ghost/filenames/match-regex': ['error', '^[a-z0-9.-]+$', false]
+                'ghost/filenames/match-regex': ['error', '^[a-z0-9]+(-[a-z0-9]+)*(\\.[a-z0-9]+(-[a-z0-9]+)*)*$', false]
             }

This pattern enforces:

  • Start with alphanumeric
  • Words separated by single hyphens
  • Optional dot-separated suffixes (e.g., .test, .spec)
  • No leading/trailing hyphens or consecutive separators
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 271042e and 8e7b834.

📒 Files selected for processing (7)
  • ghost/core/.eslintrc.js
  • ghost/core/core/frontend/services/assets-minification/minifier.js
  • ghost/core/test/unit/frontend/services/routing/collection-router.test.js
  • ghost/core/test/unit/frontend/services/routing/parent-router.test.js
  • ghost/core/test/unit/frontend/services/routing/rss-router.test.js
  • ghost/core/test/unit/frontend/services/routing/static-routes-router.test.js
  • ghost/core/test/unit/frontend/services/routing/taxonomy-router.test.js
✅ Files skipped from review due to trivial changes (1)
  • ghost/core/core/frontend/services/assets-minification/minifier.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • ghost/core/test/unit/frontend/services/routing/collection-router.test.js
  • ghost/core/test/unit/frontend/services/routing/static-routes-router.test.js
  • ghost/core/test/unit/frontend/services/routing/taxonomy-router.test.js
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: sagzy
Repo: TryGhost/Ghost PR: 24673
File: ghost/i18n/lib/i18n.js:34-35
Timestamp: 2025-11-24T11:12:15.712Z
Learning: In the Ghost i18n package (ghost/i18n/lib/i18n.js), changing existing locale codes requires backwards compatibility handling for users who have already configured those locales. Such changes should be done in a separate PR with migration logic rather than included in feature PRs.
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-11-26T11:05:59.314Z
Learning: Applies to apps/shade/src/components/**/*.{ts,tsx} : Use `PascalCase` for component identifiers in filenames while keeping ShadCN-generated files in kebab-case
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:28:50.351Z
Learning: Applies to ghost/i18n/locales/en/{portal,comments,signup-form,search}.json : Add UI translations to namespace-specific files in `ghost/i18n/locales/en/` for public UI apps (portal.json for Portal, comments.json for Comments UI, etc.)
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-11-26T11:05:59.314Z
Learning: Applies to apps/shade/src/**/*.{ts,tsx,js} : Use `camelCase` for function and variable names
Learnt from: sam-lord
Repo: TryGhost/Ghost PR: 25303
File: ghost/core/core/server/services/email-service/BatchSendingService.js:19-19
Timestamp: 2025-10-30T17:13:26.190Z
Learning: In ghost/core/core/server/services/email-service/BatchSendingService.js and similar files in the Ghost codebase, prefer using `{...options}` spread syntax without explicit guards like `...(options || {})` when spreading potentially undefined objects, as the maintainer prefers cleaner syntax over defensive patterns when the behavior is safe.
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-11-26T11:05:59.314Z
Learning: Applies to apps/shade/{src,test}/**/*.{ts,tsx,js} : Follow ESLint and `tailwindcss/*` plugin rules when writing styles
📚 Learning: 2025-11-24T17:29:43.865Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: e2e/AGENTS.md:0-0
Timestamp: 2025-11-24T17:29:43.865Z
Learning: Applies to e2e/**/*.test.ts : Test names should be lowercase and follow the format 'what is tested - expected outcome'

Applied to files:

  • ghost/core/test/unit/frontend/services/routing/rss-router.test.js
📚 Learning: 2025-11-24T11:12:15.712Z
Learnt from: sagzy
Repo: TryGhost/Ghost PR: 24673
File: ghost/i18n/lib/i18n.js:34-35
Timestamp: 2025-11-24T11:12:15.712Z
Learning: In the Ghost i18n package (ghost/i18n/lib/i18n.js), changing existing locale codes requires backwards compatibility handling for users who have already configured those locales. Such changes should be done in a separate PR with migration logic rather than included in feature PRs.

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-08-12T18:33:15.524Z
Learnt from: cmraible
Repo: TryGhost/Ghost PR: 24658
File: ghost/admin/package.json:3-3
Timestamp: 2025-08-12T18:33:15.524Z
Learning: In Ghost's admin package.json, third-party packages like ember-cli-postcss, ember-exam, and ember-power-select have their own independent versioning schemes that are unrelated to Ghost's version numbers. Version number coincidences between Ghost versions and these packages should not trigger update suggestions.

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-10-30T17:13:26.190Z
Learnt from: sam-lord
Repo: TryGhost/Ghost PR: 25303
File: ghost/core/core/server/services/email-service/BatchSendingService.js:19-19
Timestamp: 2025-10-30T17:13:26.190Z
Learning: In ghost/core/core/server/services/email-service/BatchSendingService.js and similar files in the Ghost codebase, prefer using `{...options}` spread syntax without explicit guards like `...(options || {})` when spreading potentially undefined objects, as the maintainer prefers cleaner syntax over defensive patterns when the behavior is safe.

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-11-25T14:28:50.351Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:28:50.351Z
Learning: Applies to ghost/i18n/locales/en/ghost.json : Add UI translations to `ghost/i18n/locales/en/ghost.json` for Admin UI features

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-06-13T11:57:58.226Z
Learnt from: kevinansfield
Repo: TryGhost/Ghost PR: 23824
File: ghost/core/core/server/services/email-service/email-templates/partials/styles.hbs:919-926
Timestamp: 2025-06-13T11:57:58.226Z
Learning: In `ghost/core/core/server/services/email-service/email-templates/partials/styles.hbs`, some style blocks (e.g., `.latest-post p` and `.latest-post p a`) still use the legacy colour `#73818c` on purpose; they are later overridden by `emailCustomization` feature rules, as noted by inline TODO comments. These occurrences should not be flagged as inconsistencies.

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-11-25T14:28:50.351Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T14:28:50.351Z
Learning: Applies to ghost/i18n/locales/en/{portal,comments,signup-form,search}.json : Add UI translations to namespace-specific files in `ghost/i18n/locales/en/` for public UI apps (portal.json for Portal, comments.json for Comments UI, etc.)

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-11-26T11:05:59.314Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-11-26T11:05:59.314Z
Learning: Applies to apps/shade/{src,test}/**/*.{ts,tsx,js} : Follow ESLint and `tailwindcss/*` plugin rules when writing styles

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-11-26T11:05:59.314Z
Learnt from: CR
Repo: TryGhost/Ghost PR: 0
File: apps/shade/AGENTS.md:0-0
Timestamp: 2025-11-26T11:05:59.314Z
Learning: Applies to apps/shade/src/components/**/*.{ts,tsx} : Use `PascalCase` for component identifiers in filenames while keeping ShadCN-generated files in kebab-case

Applied to files:

  • ghost/core/.eslintrc.js
📚 Learning: 2025-05-29T07:45:35.714Z
Learnt from: ErisDS
Repo: TryGhost/Ghost PR: 23582
File: ghost/core/.c8rc.json:24-24
Timestamp: 2025-05-29T07:45:35.714Z
Learning: In Ghost project, app.js files under core/server/web are intentionally excluded from unit test coverage because they are not easily unit-testable due to being entry points with initialization code and side effects.

Applied to files:

  • ghost/core/.eslintrc.js
🔇 Additional comments (2)
ghost/core/test/unit/frontend/services/routing/rss-router.test.js (1)

5-5: LGTM! Import path correctly updated to kebab-case.

The require path has been properly updated from RSSRouter to rss-router to match the renamed source file, while the variable name correctly remains in PascalCase as it references a constructor/class.

ghost/core/test/unit/frontend/services/routing/parent-router.test.js (1)

5-5: LGTM! Import path correctly updated to kebab-case.

The require path has been properly updated from ParentRouter to parent-router to match the renamed source file, while the variable name correctly remains in PascalCase as it references a constructor/class.

@ibalosh ibalosh enabled auto-merge (squash) January 7, 2026 11:26
@ibalosh ibalosh merged commit 9097c26 into main Jan 7, 2026
37 checks passed
@ibalosh ibalosh deleted the moved-to-kebab-case-core-frontend branch January 7, 2026 11:34
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.

1 participant