Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 5.0 fails #505

Open
bay73 opened this issue Jul 17, 2024 · 1 comment
Open

Update to 5.0 fails #505

bay73 opened this issue Jul 17, 2024 · 1 comment

Comments

@bay73
Copy link

bay73 commented Jul 17, 2024

Updating version of the eslint-plugin-array-func from 4.0.0 to 5.0.1 causes failures while executing lint (everything works fine in case of 4.0.0):

ESLint: 8.57.0
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-plugin-array-func/index.js from/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported.
Instead change the require of index.js in /node_modules/@eslint/eslintrc/dist/eslintrc.cjs to a dynamic import() which is available in all CommonJS modules.
    at ConfigArrayFactory._loadPlugin (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3433:42)
    at /node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3304:33
    at Array.reduce (<anonymous>)
    at ConfigArrayFactory._loadPlugins (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3300:22)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3100:[44]

We are using "eslint": "8.57.0"

Do you have any suggestion how this can be fixed?

@freaktechnik
Copy link
Owner

freaktechnik commented Jul 17, 2024

If you want to use common JS to configure eslint you will probably have to follow what the error there recommends.

I guess alternatively there is https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require

I would just use an esmodule to configure eslint if at all possible.

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

No branches or pull requests

2 participants