Skip to content

Add support for eslint.config.mjs ESM flat ESLint config #29493

@hakimio

Description

@hakimio

Current Behavior

Currently only CommonJS eslint.config.cjs flat config is supported. The other variants like .mjs, .mts and .cts should be supported too.

angular-eslint already supports both .cjs and .mjs formats: angular-eslint/angular-eslint#2068

Expected Behavior

eslint.config.mjs ESM flat ESLint config should be supported

GitHub Repo

No response

Steps to Reproduce

  1. Try to use eslint.config.mjs config with @nx/eslint:lint executor.

Nx Report

Node           : 20.18.0
OS             : win32-x64
Native Target  : x86_64-windows
bun            : 1.1.41

nx (global)            : 20.3.0
nx                     : 20.3.0
@nx/js                 : 20.3.0
@nx/jest               : 20.3.0
@nx/eslint             : 20.3.0
@nx/workspace          : 20.3.0
@nx/angular            : 20.3.0
@nx/devkit             : 20.3.0
@nx/module-federation  : 20.3.0
@nx/web                : 20.3.0
@nx/webpack            : 20.3.0
typescript             : 5.6.3

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions