Closed noriapi closed 6 months ago
Yeah I have this too. Try this:
import solid from 'eslint-plugin-solid/dist/configs/typescript.js';
If they want us to be able to do 'eslint-plugin-solid/configs/typescript'
they need to set an exports
field in the package.json...
Thanks for the issue. I think the problem is that package.json is missing the configs
directory under the "files"
key, so it's not getting bundled with the package.
One of those things that works fine when testing locally but breaks on publish.
Should be a quick fix!
It is getting bundled though:
(https://www.npmjs.com/package/eslint-plugin-solid?activeTab=code)
The issue is you have to add an exports
field I think.
Like this:
"exports": {
".": "./dist/index.js",
"./configs/typescript": "./dist/configs/typescript.js",
}
Thanks for checking! dist/configs
is getting packaged, yes, but not configs
(which just re-exports from dist/configs
to make the example import path work.
I've been hesitant to add "exports"
, since it's a breaking change and ESLint plugins are meant to be used with CJS require
, but I'll consider it. I just think that's a different issue 🙂
Ah okay, gotcha.
ESLint plugins are meant to be used with CJS require
Hopefully not for long! FlatConfig w/ ESM is the way! 😁
Absolutely, fully support the move to ESM! Just following ESLint's lead 😄 will ship this fix in the next release!
Awesome thanks!
I see this has been closed but the exports
field is still no present in current version (0.13.2
), so this is still an ongoing issue.
@joshwilsonvu exports
field is still no present in 0.14.0
.
Describe the bug Using this Flat Configuration example will result in the following error:
To Reproduce see this repo
Expected behavior no error
Environment (please complete the following information):
v20.10.0
):eslint-plugin-solid
version (0.13.0
):eslint
version (8.56.0
):Additional context