nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Support `.cjs` file extension when using eslint flat config #26636

Closed benpsnyder closed 4 months ago

benpsnyder commented 4 months ago

Current Behavior

packages/eslint/src/utils/flat-config.ts only supports eslint.config.js

Expected Behavior

packages/eslint/src/utils/flat-config.ts should support eslint.config.js and eslint.config.cjs because when "type": "module" is used in package.json flat config with eslint breaks

I am using bun instead of node and bunx --bun nx run <project>:lint is how I want to execute my linting

GitHub Repo

No response

Steps to Reproduce

Doesn't require.

Nx Report

Node   : 22.2.0
OS     : darwin-arm64
bun    : 1.1.15

nx (global)        : 19.3.0
nx                 : 19.3.1
@nx/js             : 19.3.1
@nx/jest           : 19.3.1
@nx/linter         : 19.3.1
@nx/eslint         : 19.3.1
@nx/workspace      : 19.3.1
@nx/angular        : 19.3.1
@nx/cypress        : 19.3.1
@nx/devkit         : 19.3.1
@nx/esbuild        : 19.3.1
@nx/eslint-plugin  : 19.3.1
@nx/nest           : 19.3.1
@nx/next           : 19.3.1
@nx/node           : 19.3.1
@nx/plugin         : 19.3.1
@nx/react          : 19.3.1
@nrwl/tao          : 19.3.1
@nx/vite           : 19.3.1
@nx/web            : 19.3.1
@nx/webpack        : 19.3.1
typescript         : 5.5.2
---------------------------------------
Registered Plugins:
@nx-dotnet/core
@nx/vite/plugin
@nxlv/python
---------------------------------------
Community plugins:
@analogjs/content             : 1.5.0
@analogjs/platform            : 1.5.0
@analogjs/router              : 1.5.0
@analogjs/trpc                : 0.2.45
@analogjs/vite-plugin-angular : 1.5.0
@compodoc/compodoc            : 1.1.25
@jscutlery/semver             : 5.2.2
@monodon/rust                 : 1.4.0
@ngrx/component-store         : 18.0.0
@ngrx/schematics              : 18.0.0
@ngrx/store                   : 18.0.0
@ngxpert/cmdk                 : 2.0.0
@nx-dotnet/core               : 2.2.0
@nx-tools/nx-container        : 6.0.1
@nx/rspack                    : 19.1.0
@nxlv/python                  : 18.1.0
@storybook/angular            : 8.1.10
@syccure/authorization        : 0.1.0
eslint-plugin-ngrx            : 2.1.4
ngx-toastr                    : 19.0.0

Failure Logs

No response

Package Manager Version

bun 1.1.15

Operating System

Additional Information

No response

github-actions[bot] commented 3 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.