Skip to content

Conversation

@valoriecarli
Copy link
Contributor

@valoriecarli valoriecarli commented Jan 30, 2026

updated experimental branch, original here
Currently under test with commercetools/ui-kit#3216


ESLint 9's flat config format is fundamentally incompatible with ESLint 8's .eslintrc format as they use different structures (array of config objects vs. single object with extends/overrides). While backwards compatibility is technically possible, it would require maintaining two parallel config structures indefinitely.

By creating separate packages, we freeze the legacy package in maintenance mode (security fixes only) while all active development happens in the new -flat packages. This approach trades a one-time consumer migration cost for ongoing maintainer simplicity, eliminates version detection risks & provides a clean path to eventually sunset ESLint 8 support by removing the deprecated packages entirely.


This PR contains the following:

1.) New packages

  • FE: @commercetools-frontend/eslint-config-mc-app-flat
  • BE: @commercetools-backend/eslint-config-node-flat

2.) Workspace migration to the flat config format, consolidating the linting logic into a single eslint.config.js:

  • Extends the newly created @commercetools-frontend/eslint-config-mc-app-flat
  • Centralized exclusion of build artifacts (dist/, build/), localization files (_translations/), and internal caches (.cache/)
  • Implemented custom path groups to enforce a strict import hierarchy for React, Emotion, UI-Kit, and internal AppKit packages
  • Configured context-aware linting for 5 GraphQL schema types (MC, CTP, Core, Settings, and Proxy) by mapping file patterns to their respective JSON schemas.

3.) To ensure compatibility with the flat config system and ESLint 9, the following modifications were implemented:

  • Flat config conversion - Migrated from the .eslintrc object structure to the new array-based configuration
  • Dependency upgrades:
    • TS-ESLint v8 - Required for ESLint 9 support
    • eslint-plugin-jest v28 - Updated for compatibility
    • globals v15.15.0 - Necessary for explicit global definitions in the flat format
  • Targeting logic - Replaced legacy overrides with modern files: [...] pattern-based targeting
  • Frontend specifics:
    • Updated React/JSX plugins and rules
    • Upgraded eslint-plugin-testing-library to v6
    • Integrated Cypress plugin and browser globals
  • Backend Specifics:
    • Integrated eslint-plugin-n for Node.js specific linting
    • Scoped globals strictly to Node.js environments

4.) Legacy package deprecation

  • For both @commercetools-frontend/eslint-config-mc-app & @commercetools-backend/eslint-config-node
    • Added deprecated field to package.json pointing users toward the new -flat alternatives
    • Inserted JSDoc deprecation notices in index.js
    • Locked at TS-ESLint v5.62.0 to maintain stability & support for legacy ESLint 8 environments
    • Added runtime deprecation warnings when legacy packages are loaded

5.) Misc (appkit):

  • Legacy files removed
  • READMEs, Application Templates, Playground, & Testing apps updated
  • Minor updates for newly enforced linting rules
  • Refactored GraphQL config to use helper function

Consumer impact

  • Existing packages continue to work with ESLint 8.x (no breaking changes)
  • Migration to new -flat packages required when upgrading to ESLint 9
  • READMEs include step-by-step migration guides
  • Legacy packages are deprecated

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2026

🦋 Changeset detected

Latest commit: f06f485

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@commercetools-backend/eslint-config-node-flat Major
@commercetools-backend/eslint-config-node Major
@commercetools-frontend/eslint-config-mc-app-flat Major
@commercetools-frontend/eslint-config-mc-app Major
@commercetools-frontend/application-shell Major
@commercetools-backend/express Major
@commercetools-frontend/permissions Major
@commercetools-applications/merchant-center-template-starter-typescript Major
@commercetools-applications/merchant-center-template-starter Major
@commercetools-applications/merchant-center-custom-view-template-starter-typescript Major
@commercetools-applications/merchant-center-custom-view-template-starter Major
@commercetools-frontend/cypress Major
@commercetools-local/playground Major
@commercetools-local/visual-testing-app Major
@commercetools-backend/loggers Major
@commercetools-frontend/actions-global Major
@commercetools-frontend/application-components Major
@commercetools-frontend/application-config Major
@commercetools-frontend/application-shell-connectors Major
@commercetools-frontend/assets Major
@commercetools-frontend/babel-preset-mc-app Major
@commercetools-frontend/browser-history Major
@commercetools-frontend/codemod Major
@commercetools-frontend/constants Major
@commercetools-frontend/create-mc-app Major
@commercetools-frontend/i18n Major
@commercetools-frontend/jest-preset-mc-app Major
@commercetools-frontend/jest-stylelint-runner Major
@commercetools-frontend/l10n Major
@commercetools-frontend/mc-dev-authentication Major
@commercetools-frontend/mc-html-template Major
@commercetools-frontend/mc-scripts Major
@commercetools-frontend/notifications Major
@commercetools-frontend/react-notifications Major
@commercetools-frontend/sdk Major
@commercetools-frontend/sentry Major
@commercetools-frontend/url-utils Major
@commercetools-website/components-playground Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mc-app-kit-playground Ready Ready Preview, Comment Feb 4, 2026 6:25pm
merchant-center-application-kit-components-playground Ready Ready Preview, Comment Feb 4, 2026 6:25pm

Request Review

Copy link

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Failed Failed Vulnerabilities high 2   medium 4   low 0   info 0 View in Orca
☢️ The following Vulnerabilities (CVEs) have been detected
PACKAGE FILE CVE ID INSTALLED VERSION FIXED VERSION
high diff ./pnpm-lock.yaml CVE-2026-24001 5.2.0 8.0.3, 5.2.2, 4.0.4 View in code
high glob ./pnpm-lock.yaml CVE-2025-64756 10.4.5 11.1.0, 10.5.0 View in code
high node-forge ./pnpm-lock.yaml CVE-2025-12816 1.3.1 1.3.2 View in code
high node-forge ./pnpm-lock.yaml CVE-2025-66031 1.3.1 1.3.2 View in code
high tar ./pnpm-lock.yaml CVE-2026-23745 6.2.1 7.5.3 View in code
high tar ./pnpm-lock.yaml CVE-2026-23950 6.2.1 7.5.4 View in code
high tar ./pnpm-lock.yaml CVE-2026-24842 6.2.1 7.5.7 View in code

@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.98%. Comparing base (9796b90) to head (f06f485).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3931   +/-   ##
=======================================
  Coverage   71.98%   71.98%           
=======================================
  Files         263      263           
  Lines        6793     6793           
  Branches     2074     2102   +28     
=======================================
  Hits         4890     4890           
  Misses       1882     1882           
  Partials       21       21           
Components Coverage Δ
Application Components 81.18% <ø> (ø)
Application Shell 74.54% <ø> (ø)
Application Shell Connectors 77.54% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9796b90...f06f485. Read the comment docs.

🚀 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.

@valoriecarli valoriecarli changed the title CRAFT-2074-eslint v9 migration [new pkg] CRAFT-2074-eslint v9 migration [new pkgs] Feb 3, 2026
@commercetools commercetools deleted a comment from github-actions bot Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants