Tracking issue specifically for the ESLint issue that was raised here - eslint/eslint#12319.
Tooling often rely on configuration scripts. Examples include .eslintrc.js, karma.conf.js, webpack.config.js, babel.config.js to name a few.
These tools typically load those configuration files with a require.
When an existing project with such a configuration adds "type": "module" to the package.json, they get the ERR_REQUIRE_ESM dual hazard error that we added recently in nodejs/node#29492.
The ideal upgrade path is to have the tools support using import() for loading their configurations. Alternatively they could support .cjs as well.
We should probably reach out with this information to tools and get further feedback as well.
Tracking issue specifically for the ESLint issue that was raised here - eslint/eslint#12319.
Tooling often rely on configuration scripts. Examples include
.eslintrc.js,karma.conf.js,webpack.config.js,babel.config.jsto name a few.These tools typically load those configuration files with a
require.When an existing project with such a configuration adds
"type": "module"to the package.json, they get the ERR_REQUIRE_ESM dual hazard error that we added recently in nodejs/node#29492.The ideal upgrade path is to have the tools support using
import()for loading their configurations. Alternatively they could support.cjsas well.We should probably reach out with this information to tools and get further feedback as well.