-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
Current behavior
When yo eslint:plugin is used to generate a new plugin, running the script lint:js fails with
TypeError: Plugin config "mixed-esm-and-cjs" not found in plugin "n".
This is a regression introduced in [email protected]. The release [email protected] does not have this issue.
Expected behavior
When yo eslint:plugin is used to generate a new plugin, running the script lint:js should succeed out-of-the-box.
Versions
| Component | Version |
|---|---|
| Ubuntu | 24.04.3 LTS |
| Node.js | v22.20.0 LTS |
| npm | 10.9.3 |
yo |
5.1.0 |
generator-eslint |
5.2.1 |
eslint |
9.37.0 |
eslint-plugin-n |
17.23.1 |
eslint-plugin-eslint-plugin |
6.5.0 |
Steps to reproduce
npm install yo@latest -g
npm install generator-eslint@latest -gcd $(mktemp -d)
yo eslint:pluginand accept defaults:
$ yo eslint:plugin
? What is your name? Tester
? What is the plugin ID? template-test
? Type a short description of this plugin: Template test
? Does this plugin contain custom ESLint rules? Yes
? Does this plugin contain one or more processors? No
create package.json
create eslint.config.mjs
create lib/index.js
create README.md
Changes to package.json were detected.
Error detecting the package manager. Falling back to npm.
Running npm install for you to install the required dependencies.
added 242 packages, and audited 243 packages in 16s
70 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
Then execute linting:
npm run lint:jsLogs
$ npm run lint:js
> [email protected] lint:js
> eslint .
Oops! Something went wrong! :(
ESLint: 9.37.0
TypeError: Plugin config "mixed-esm-and-cjs" not found in plugin "n".
at findPluginConfig (/tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:287:8)
at /tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:423:25
at Array.map (<anonymous>)
at processExtends (/tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:421:36)
at /tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:497:38
at Array.flatMap (<anonymous>)
at processConfigList (/tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:497:20)
at defineConfig (/tmp/tmp.6CcU4BUgW5/node_modules/@eslint/config-helpers/dist/cjs/index.cjs:533:9)
at file:///tmp/tmp.6CcU4BUgW5/eslint.config.mjs?mtime=1759647699530:6:16
at ModuleJob.run (node:internal/modules/esm/module_job:345:25)
Other
The failing configuration is for eslint-plugin-n
See template plugin/templates/_eslint.config.mjs