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

Warn me when I use module.exports.default #91

Open
mmkal opened this issue Sep 16, 2024 · 2 comments
Open

Warn me when I use module.exports.default #91

mmkal opened this issue Sep 16, 2024 · 2 comments

Comments

@mmkal
Copy link
Contributor

mmkal commented Sep 16, 2024

👋 small request here that could have saved me a bunch of time debugging. When I accidentally do module.exports.default = myConfig, the config inspector will tell me what a great config I have and how it applies loads of interesting rules to all kinds of different files. But running npx eslint (with v8.57.1) just tells me everything is ignored.

By adding lots of console.logs to eslint in my node_modules, I was able to see that one of my configs looked like { default: [...] } and that told me what to fix, but it would have been handy if the config inspector had said the config looked bad - or at least didn't tell me it was working perfectly.

@voxpelli
Copy link
Contributor

My guess is that this is due to ESM / CJS compatibility stuff that differs between the implementations

I wonder where that difference is

@mmkal
Copy link
Contributor Author

mmkal commented Sep 17, 2024

Yeah, maybe this library is doing a if (config.default) config = config.default check somewhere and eslint isn't.

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