Skip to content

refactor: standardize eslint configs#7560

Merged
mikeallisonJS merged 13 commits intomainfrom
mikeallison/eng-3158-standardize-eslint-configs
Aug 29, 2025
Merged

refactor: standardize eslint configs#7560
mikeallisonJS merged 13 commits intomainfrom
mikeallison/eng-3158-standardize-eslint-configs

Conversation

@mikeallisonJS
Copy link
Collaborator

@mikeallisonJS mikeallisonJS commented Aug 28, 2025

Summary by CodeRabbit

  • Chores

    • Centralized ESLint configuration across apps, APIs, libs, and e2e projects using shared presets (Next.js, API, E2E, Yoga).
    • Simplified local overrides and standardized ignore patterns for more consistent linting.
    • Updated TypeScript configs to include additional project files (e.g., Next/PostCSS/Jest) where applicable.
  • Refactor

    • Replaced bespoke per-project lint setups with shared configurations to streamline maintenance.
  • Tests

    • Minor cleanup: converted several async tests to synchronous equivalents without changing behavior.

…ries to use shared configurations

- Modified ESLint configurations in various apps and libraries to import from shared ESLint configurations.
- Updated rules in the main ESLint config to enforce stricter unused variable checks.
- Removed redundant configurations and streamlined ESLint setups for better maintainability.
- Updated ESLint configurations in various apps and libraries to consistently import from shared configurations.
- Removed redundant rules and streamlined setups for improved maintainability.
- Adjusted specific ESLint rules and ignored files to enhance project-specific linting.
- Deleted the ESLint configuration file `eslint.config.mjs` to streamline project setup.
- This change may indicate a shift towards using shared ESLint configurations across projects.
@mikeallisonJS mikeallisonJS self-assigned this Aug 28, 2025
@linear
Copy link

linear bot commented Aug 28, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Centralizes ESLint configuration by introducing shared configs (common, next, api, e2e, yogaWithReactEmail) and updating many project-specific eslint.config.mjs files to re-export these. Adjusts some ignore patterns and a few per-file overrides. Adds ESLint tsconfig for shared configs and minor TS config/test tweaks in select apps.

Changes

Cohort / File(s) Summary
Shared ESLint framework
libs/shared/eslint/common.mjs, libs/shared/eslint/next.mjs, libs/shared/eslint/api.mjs, libs/shared/eslint/e2e.mjs, libs/shared/eslint/yogaWithReactEmail.mjs, libs/shared/eslint/tsconfig.json
Introduces centralized ESLint configs. common.mjs refactored to export a static commonConfig with reorganized blocks and ignores. Adds next.mjs, api.mjs, e2e.mjs, yogaWithReactEmail.mjs. Adds ESLint-focused TS config.
APIs: switch to shared configs
apis/api-analytics/eslint.config.mjs, apis/api-gateway/eslint.config.mjs, apis/api-journeys/eslint.config.mjs, apis/api-journeys-modern/eslint.config.mjs, apis/api-languages/eslint.config.mjs, apis/api-media/eslint.config.mjs, apis/api-users/eslint.config.mjs, apis/media-transcoder/eslint.config.mjs
Replace local composite configs with shared ones: api.mjs, common.mjs, or yogaWithReactEmail.mjs. Remove local ignores and tsconfig parserOptions; retain minimal overrides where noted (e.g., specific ignores).
Apps (Next.js): delegate to shared next config
apps/arclight/eslint.config.mjs, apps/docs/eslint.config.mjs, apps/journeys-admin/eslint.config.mjs, apps/journeys/eslint.config.mjs, apps/short-links/eslint.config.mjs, apps/videos-admin/eslint.config.mjs, apps/watch/eslint.config.mjs, apps/watch-modern/eslint.config.mjs
Replace plugin-heavy/baseConfig setups with ...nextConfig; simplify ignores and keep targeted per-file rule overrides where needed (e.g., no-html-link-for-pages, jest/next ignores, TS rule tweaks).
Apps (E2E): delegate to shared e2e config
apps/arclight-e2e/eslint.config.mjs, apps/docs-e2e/eslint.config.mjs, apps/journeys-admin-e2e/eslint.config.mjs, apps/journeys-e2e/eslint.config.mjs, apps/short-links-e2e/eslint.config.mjs, apps/video-importer-e2e/eslint.config.mjs, apps/videos-admin-e2e/eslint.config.mjs, apps/watch-e2e/eslint.config.mjs, apps/watch-modern-e2e/eslint.config.mjs
Replace local arrays (compat + Playwright + overrides) with e2eConfig from shared module; drop local parserOptions and per-file overrides except those baked into e2eConfig.
UI libs (Next-based): delegate to shared next config
libs/shared/ui/eslint.config.mjs, libs/shared/ui-dynamic/eslint.config.mjs, libs/journeys/ui/eslint.config.mjs
Switch from baseConfig + plugins to ...nextConfig. Simplify ignores and retain minimal TS rule blocks without parserOptions projects.
Nest libs: delegate to shared common config
libs/nest/common/eslint.config.mjs, libs/nest/decorators/eslint.config.mjs, libs/nest/gqlAuthGuard/eslint.config.mjs, libs/nest/powerBi/eslint.config.mjs
Replace bespoke arrays (ignores + TS parserOptions/rules) with commonConfig.
Prisma libs: delegate to shared common config
libs/prisma/analytics/eslint.config.mjs, libs/prisma/journeys/eslint.config.mjs, libs/prisma/languages/eslint.config.mjs, libs/prisma/media/eslint.config.mjs, libs/prisma/users/eslint.config.mjs
Replace local composite configs (ignores + TS rules) with commonConfig.
Other package configs
libs/shared/ai/eslint.config.mjs, libs/yoga/eslint.config.mjs, workers/jf-proxy/eslint.config.mjs, apps/video-importer/eslint.config.mjs
libs/shared/ai: switch to ...commonConfig and trim ignores. libs/yoga: re-export yogaWithReactEmail. workers/jf-proxy: re-export commonConfig. apps/video-importer: re-export shared commonConfig.
TypeScript config updates
apps/arclight/tsconfig.json, apps/journeys/tsconfig.eslint.json, apps/journeys/tsconfig.json
Adjust includes/excludes: add Next/PostCSS/Jest config files to TS/ESLint coverage; remove jest.config.ts from excludes in arclight.
Test adjustments
apps/watch/src/libs/watchContext/useLanguageActions/useLanguageActions.spec.tsx
Convert four async tests to synchronous (removed async wrappers); assertions unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as ESLint CLI
  participant P as Project eslint.config.mjs
  participant S as Shared Config (next/api/e2e/yoga)
  participant C as commonConfig

  Dev->>P: Load config
  P-->>S: Import shared preset
  S-->>C: Import and spread commonConfig
  C-->>S: Provide base rules/overrides
  S-->>P: Return composed shared config
  P-->>Dev: Export final config (plus minimal local overrides)
Loading
sequenceDiagram
  autonumber
  actor Dev as ESLint CLI
  participant NextApp as apps/*/eslint.config.mjs
  participant NextCfg as libs/shared/eslint/next.mjs
  participant Common as libs/shared/eslint/common.mjs

  Dev->>NextApp: Load
  NextApp-->>NextCfg: ...nextConfig
  NextCfg-->>Common: Spread commonConfig
  Common-->>NextCfg: Base + JS/TS blocks + ignores
  NextCfg-->>NextApp: Next plugin rules + NX extends + base
  NextApp-->>Dev: Add app-specific ignores/rules and export
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • tanflem
  • jianwei1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fb21485 and 2996870.

📒 Files selected for processing (1)
  • apps/watch/src/libs/watchContext/useLanguageActions/useLanguageActions.spec.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/watch/src/libs/watchContext/useLanguageActions/useLanguageActions.spec.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Deploy Preview (short-links, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (watch-modern, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (videos-admin, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (watch, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (journeys-admin, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (journeys, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (arclight, 7560/merge, pull_request, 22)
  • GitHub Check: Deploy Preview (docs, 7560/merge, pull_request, 22)
  • GitHub Check: build (22)
  • GitHub Check: test (22, 1/3)
  • GitHub Check: test (22, 3/3)
  • GitHub Check: test (22, 2/3)
  • GitHub Check: lint (22)
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mikeallison/eng-3158-standardize-eslint-configs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mikeallisonJS mikeallisonJS changed the title refactorL standardize eslint configs refactor: standardize eslint configs Aug 28, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Warnings
⚠️ ❗ Big PR (1301 changes)

(change count - 1301): Pull Request size seems relatively large. If Pull Request contains multiple changes, split each into separate PR will helps faster, easier review.

Generated by 🚫 dangerJS against 2996870

@nx-cloud
Copy link

nx-cloud bot commented Aug 28, 2025

View your CI Pipeline Execution ↗ for commit 2996870

Command Status Duration Result
nx run arclight-e2e:e2e ✅ Succeeded 41s View ↗
nx run journeys-admin-e2e:e2e ✅ Succeeded 29s View ↗
nx run videos-admin-e2e:e2e ✅ Succeeded 6s View ↗
nx run watch-e2e:e2e ✅ Succeeded 11s View ↗
nx run watch-modern-e2e:e2e ✅ Succeeded 6s View ↗
nx run short-links-e2e:e2e ✅ Succeeded 6s View ↗
nx run docs-e2e:e2e ✅ Succeeded 3s View ↗
nx run journeys-e2e:e2e ✅ Succeeded 1s View ↗
Additional runs (24) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-08-29 21:41:23 UTC

@github-actions github-actions bot temporarily deployed to Preview - short-links August 28, 2025 23:22 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin August 28, 2025 23:22 Inactive
@github-actions github-actions bot had a problem deploying to Preview - watch-modern August 28, 2025 23:22 Failure
@github-actions github-actions bot temporarily deployed to Preview - arclight August 28, 2025 23:22 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin August 28, 2025 23:22 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys August 28, 2025 23:22 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
docs ✅ Ready docs preview Sat Aug 30 09:36:18 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
arclight ✅ Ready arclight preview Sat Aug 30 09:36:50 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
short-links ✅ Ready short-links preview Sat Aug 30 09:36:41 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys ✅ Ready journeys preview Sat Aug 30 09:37:14 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
videos-admin ✅ Ready videos-admin preview Sat Aug 30 09:37:31 NZST 2025

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

The latest updates on your projects.

Name Status Preview Updated (UTC)
journeys-admin ✅ Ready journeys-admin preview Sat Aug 30 09:38:22 NZST 2025

…rneys Admin apps

- Introduced `next.config.js` files for the Arclight, Journeys, and Journeys Admin applications.
- Configurations include support for internationalization, image optimization, and custom rewrites.
- Integrated plugins such as `withNx` and `withPlausibleProxy` for enhanced functionality.
- Set up production source maps and TypeScript error handling for CI environments.
…s for multiple apps

- Added specific ignores for ESLint configurations in Arclight, Journeys, Journeys Admin, Watch, and Watch Modern apps to exclude Next.js config files.
- Deleted `next.config.ts` files for Arclight, Journeys, Journeys Admin, Watch, and Watch Modern apps to streamline project structure and reduce redundancy.
- Enhanced maintainability by standardizing ESLint setups across applications.
@github-actions github-actions bot temporarily deployed to Preview - videos-admin August 29, 2025 00:34 Inactive
@github-actions github-actions bot requested a deployment to Preview - journeys August 29, 2025 00:34 Pending
@github-actions github-actions bot temporarily deployed to Preview - watch-modern August 29, 2025 00:34 Inactive
- Deleted the path mapping for "@core/shared/eslint/*" to streamline TypeScript configuration and improve clarity.
@github-actions github-actions bot temporarily deployed to Preview - arclight August 29, 2025 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys August 29, 2025 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin August 29, 2025 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - short-links August 29, 2025 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern August 29, 2025 02:05 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin August 29, 2025 02:05 Inactive
@mikeallisonJS mikeallisonJS added this pull request to the merge queue Aug 29, 2025
@mikeallisonJS mikeallisonJS removed this pull request from the merge queue due to a manual request Aug 29, 2025
@github-actions github-actions bot temporarily deployed to Preview - journeys-admin August 29, 2025 21:34 Inactive
@github-actions github-actions bot temporarily deployed to Preview - short-links August 29, 2025 21:34 Inactive
@github-actions github-actions bot temporarily deployed to Preview - arclight August 29, 2025 21:34 Inactive
@github-actions github-actions bot temporarily deployed to Preview - watch-modern August 29, 2025 21:34 Inactive
@github-actions github-actions bot temporarily deployed to Preview - videos-admin August 29, 2025 21:34 Inactive
@github-actions github-actions bot temporarily deployed to Preview - journeys August 29, 2025 21:34 Inactive
@mikeallisonJS mikeallisonJS added this pull request to the merge queue Aug 29, 2025
Merged via the queue into main with commit 6a4848d Aug 29, 2025
45 checks passed
@mikeallisonJS mikeallisonJS deleted the mikeallison/eng-3158-standardize-eslint-configs branch August 29, 2025 21:44
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