Skip to content

Changed apps/comments-ui + apps/signup-form to ESLint 9 / flat config#28801

Merged
9larsons merged 2 commits into
mainfrom
eslint9-04-comments-and-signup
Jun 22, 2026
Merged

Changed apps/comments-ui + apps/signup-form to ESLint 9 / flat config#28801
9larsons merged 2 commits into
mainfrom
eslint9-04-comments-and-signup

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Summary

  • Replaced .eslintrc.js / .eslintrc.cjs with eslint.config.js in both packages.
  • Swapped eslint: catalog: to catalog:eslint9 and added @eslint/js, globals, eslint-plugin-react, eslint-plugin-ghost, typescript-eslint (unified) as direct deps. eslint-plugin-tailwindcss stays at catalog:tailwind3.
  • Dropped the legacy plugin:ghost/ts + plugin:react/recommended (+ plugin:i18next/recommended for comments-ui) extends. Formatting rules removed from ESLint 9 core dropped; non-formatting rules preserved inline.
  • ESLint 9 dropped the --ext CLI flag; lint scripts now pass directory args.
  • Disabled base no-unused-vars and configured @typescript-eslint/no-unused-vars with `argsIgnorePattern: '^_'` and `caughtErrors: 'none'` — matches the legacy plugin:ghost/ts posture (interface signatures and unused catch bindings stay tolerated).
  • Modernized both packages to ESM (`"type": "module"`). Zero CJS in src/test for either workspace; just makes the declaration match runtime. Drops the need for an .mjs extension on the eslint config.
  • Bumped `comments-ui` 1.5.12 → 1.5.13 and `signup-form` 0.3.27 → 0.3.28; both stay within the ~1.5 / ~0.3 ranges pinned in defaults.json.

Test plan

  • CI lint passes
  • CI app version bump check passes
  • `pnpm --filter @tryghost/comments-ui lint` is green locally
  • `pnpm --filter @tryghost/signup-form lint` is green locally
  • `pnpm --filter @tryghost/comments-ui test:unit` is green locally (251/251)

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e29a1a84-49f7-416c-81d5-1ba0f0f68149

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Both apps/comments-ui and apps/signup-form migrate their ESLint setup from the legacy .eslintrc.js/.eslintrc.cjs format to ESLint flat config. Each package removes its old eslintrc file and adds a new eslint.config.js that imports typescript-eslint, React, i18next (comments-ui only), Ghost, and Tailwind CSS plugins, defines a ghostRules object, and exports a tseslint.config(...) call with ignore globs, file targeting, language options, plugin registrations, and rule overrides. The lint and lint:js scripts in both package.json files are simplified to drop the explicit --ext flag. devDependencies are updated to add @eslint/js, eslint-plugin-ghost, globals, and typescript-eslint with catalog:eslint9 references. Additionally, comments-ui/test/utils/e2e.ts is refactored from inline CommonJS require('os') to a top-level ESM import.

Possibly related PRs

  • TryGhost/Ghost#28797: Adds ESLint 9 flat-config setup and updates lint tooling in another app's package.json.
  • TryGhost/Ghost#28800: Performs ESLint 9 flat-config migration with eslint.config.js and also refactors a test utility from CommonJS require() to ESM imports.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: migrating both apps to ESLint 9 with flat config format.
Description check ✅ Passed The description is well-structured and directly relates to the changeset, explaining the configuration migration, rule adjustments, module system changes, and version bumps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch eslint9-04-comments-and-signup

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.

@9larsons 9larsons enabled auto-merge (squash) June 22, 2026 18:42
@nx-cloud

nx-cloud Bot commented Jun 22, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 269e815

Command Status Duration Result
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 10m 27s View ↗
nx build @tryghost/activitypub ✅ Succeeded 3s View ↗
nx build @tryghost/sodo-search ✅ Succeeded <1s View ↗
nx build @tryghost/portal ✅ Succeeded 1s View ↗
nx build @tryghost/comments-ui ✅ Succeeded <1s View ↗
nx build @tryghost/announcement-bar ✅ Succeeded <1s View ↗
nx build @tryghost/admin-toolbar ✅ Succeeded <1s View ↗
nx build @tryghost/signup-form ✅ Succeeded <1s 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 19:23:57 UTC

ref https://linear.app/tryghost/

- replaced .eslintrc.* with eslint.config.js in both packages
- swapped catalog: to catalog:eslint9, added @eslint/js, globals,
  eslint-plugin-react, eslint-plugin-ghost, typescript-eslint (unified)
- eslint-plugin-tailwindcss already at catalog:tailwind3 (no change)
- 'no-unused-vars' off + '@typescript-eslint/no-unused-vars' configured to
  match the legacy ghost/ts behavior (skip args, ignore _ prefix, skip catches)
- modernized both packages to ESM ('type': 'module'); zero CJS in src/test
  for either workspace
- bumped comments-ui 1.5.12→1.5.13 (~1.5 range in defaults.json)
- bumped signup-form 0.3.27→0.3.28 (~0.3 range in defaults.json)
@9larsons 9larsons force-pushed the eslint9-04-comments-and-signup branch from 1ad273b to acc4d33 Compare June 22, 2026 18:55
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.86%. Comparing base (87aab1f) to head (269e815).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28801      +/-   ##
==========================================
- Coverage   73.89%   73.86%   -0.03%     
==========================================
  Files        1559     1559              
  Lines      134722   134722              
  Branches    16211    16208       -3     
==========================================
- Hits        99555    99515      -40     
- Misses      34157    34227      +70     
+ Partials     1010      980      -30     
Flag Coverage Δ
admin-tests 55.16% <ø> (ø)
e2e-tests 75.97% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@9larsons 9larsons merged commit 5242eab into main Jun 22, 2026
54 checks passed
@9larsons 9larsons deleted the eslint9-04-comments-and-signup branch June 22, 2026 19:31
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