Changed ghost/admin (Ember) to ESLint 9 / flat config#28808
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe pull request removes the legacy 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx build @tryghost/sodo-search |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/portal |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/signup-form |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/activitypub |
✅ Succeeded | 3s | View ↗ |
nx build @tryghost/announcement-bar |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/comments-ui |
✅ Succeeded | <1s | View ↗ |
nx build @tryghost/admin-toolbar |
✅ Succeeded | <1s | View ↗ |
nx run @tryghost/admin-x-settings:test:acceptance |
✅ Succeeded | 9m 57s | View ↗ |
Additional runs (15) |
✅ Succeeded | ... | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-06-22 22:58:41 UTC
There was a problem hiding this comment.
🧹 Nitpick comments (1)
eslint.config.mjs (1)
8-12: 🎯 Functional Correctness | 🔵 TrivialApply
sourceType: 'module'to.mjsfiles in the ESLint configuration.Line 8 applies
sourceType: 'script'toscripts/**/*.mjs, which would break lint parsing if.mjsfiles useimport/exportsyntax. While no.mjsfiles currently exist inscripts/, it's good practice to split the configuration by extension to prevent issues if they're added later.Suggested fix
export default [ { - files: ['scripts/**/*.{js,cjs,mjs}'], + files: ['scripts/**/*.{js,cjs}'], languageOptions: { ecmaVersion: 2022, sourceType: 'script', globals: globals.node } + }, + { + files: ['scripts/**/*.mjs'], + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + globals: globals.node + } + } ];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@eslint.config.mjs` around lines 8 - 12, The ESLint configuration at line 8 applies `sourceType: 'script'` to all files matching `scripts/**/*.{js,cjs,mjs}`, but `.mjs` files require `sourceType: 'module'` to properly parse ES module syntax with import/export statements. Split the configuration into two separate rules: one for `scripts/**/*.{js,cjs}` files keeping `sourceType: 'script'`, and a new rule for `scripts/**/*.mjs` files with `sourceType: 'module'` to ensure correct parsing of ES module syntax in `.mjs` files.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@eslint.config.mjs`:
- Around line 8-12: The ESLint configuration at line 8 applies `sourceType:
'script'` to all files matching `scripts/**/*.{js,cjs,mjs}`, but `.mjs` files
require `sourceType: 'module'` to properly parse ES module syntax with
import/export statements. Split the configuration into two separate rules: one
for `scripts/**/*.{js,cjs}` files keeping `sourceType: 'script'`, and a new rule
for `scripts/**/*.mjs` files with `sourceType: 'module'` to ensure correct
parsing of ES module syntax in `.mjs` files.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: abb8c048-f8b9-4f82-97c3-388d2d09e8f5
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
eslint.config.mjsghost/admin/.eslintrc.jsghost/admin/eslint.config.mjsghost/admin/mirage/.eslintrc.jsghost/admin/package.jsonpackage.jsonscripts/.eslintrc.js
💤 Files with no reviewable changes (3)
- scripts/.eslintrc.js
- ghost/admin/mirage/.eslintrc.js
- ghost/admin/.eslintrc.js
ref https://linear.app/tryghost/ - migrated ghost/admin/.eslintrc.js + ghost/admin/mirage/.eslintrc.js to a single eslint.config.mjs - kept @babel/eslint-parser with the same legacy-decorators + JSX + class-properties babel options - spread eslint-plugin-ember rules in flat form (eslint-plugin-ember@12.7.5 still ships legacy configs; flat config consumers register the plugin and apply rules manually) - preserved every legacy ember-rule override (no-controller-access-in-routes, no-classic-classes, no-mixins, etc.) and the react jsx-uses-* rules - mirage/.eslintrc.js's lone 'brace-style: off' override dropped (rule removed from ESLint 9 core) - folded the root + scripts work deferred from slice 7: - added root eslint.config.mjs for files outside any workspace (scripts/) - deleted scripts/.eslintrc.js - switched root devDeps eslint to catalog:eslint9 + added globals - now that ghost/admin uses flat config too, ESLint 8.50+'s flat-config auto-detection no longer conflicts with .eslintrc fallback
1771d00 to
a607094
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28808 +/- ##
=======================================
Coverage 74.07% 74.07%
=======================================
Files 1560 1560
Lines 134826 134826
Branches 16316 16315 -1
=======================================
+ Hits 99875 99876 +1
+ Misses 33941 33940 -1
Partials 1010 1010
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|

Summary
ghost/admin/.eslintrc.jsandghost/admin/mirage/.eslintrc.jswith a singleeslint.config.mjs.@babel/eslint-parserwith the same legacy-decorators + JSX + class-properties babel options. Ember decorator syntax (@service,@tracked, etc.) requires this parser; ESLint 9's default Espree can't handle it.eslint-plugin-ember@12.7.5still ships legacy.eslintrc-style configs; flat-config consumers register the plugin and apply rules manually. Every legacy ember-rule override (no-controller-access-in-routes,no-classic-classes,no-classic-components,no-mixins, etc.) is preserved.jsx-uses-react/jsx-uses-varsrules preserved for the in-repo addons that include JSX.mirage/.eslintrc.js's lone'brace-style': 'off'override dropped — the rule was removed from ESLint 9 core.The root
eslint.config.mjs+scripts/.eslintrc.jsmigration that was originally bundled here is deferred to slice 10. ESLint 8.50+'s flat-config auto-detection would have flippedghost/i18nandghost/parse-email-address(still on.eslintrcuntil slice 7 merges) to flat-config mode if the root config landed here, breaking their lint. Moving it to slice 10 means the root config lands after every workspace is already on flat config.Test plan