Closed vicary closed 3 months ago
Can you share a minimal reproduction? Thanks
@antfu It turns out to be a unique combination of seemingly unrelated issues, please checkout this minrep https://github.com/vicary/eslint-config-inspector-mjs
All of the followings must be true to trigger this bug:
eslint.config.mjs
instead of eslint.config.js
@eslint/eslintrc
in the filetsconfig.json
with a path
of *
pointing to anywhereI am not sure how does tsconfig.json
affects the require path of eslint.config.mjs
, but it seems to be the culprit.
Why you are having "*": ["node_modules/*"]
- it looks problematic to me. The config inspector use bundle-require to import the config file, which is powered by esbuild and respects your tsconfig.json. I would try to see if it's possible to disable tsconfig looking up - but I am not sure if your tsconfig.json is correct in the mean time
It is for a specific issue when the project root contains a directory with the same name as one of those inside node_modules.
When we have node_modules/graphql/
installed, our graphql/index.ts
would break at the following import statement because the bare module identifier resolves to itself.
import * as graphql from "graphql";
This happens whenever importing the config crosses from ESM into CJS. Minimal reproduction
Looks like a limitation of bundle-require
@antfu given you've done https://github.com/egoist/bundle-require/pull/45, should someone next be making a PR here to explicitly pass tsconfig: false
when calling bundleRequire
?
My project is not ESM ready, therefore I have to use the
.mjs
extension to let only eslint use ESM.The analyzer fails to pick up the config file, but fails with an irrelevant error message.
Is it possible to support
eslint.config.mjs
?