tinyplex / tinybase

The reactive data store for local‑first apps.
https://tinybase.org
MIT License
3.91k stars 89 forks source link

ESlint errors from import/no-unresolved #150

Closed cpojer closed 5 months ago

cpojer commented 6 months ago

Describe the bug

Somehow pnpm v9 and eslint with the import/no-unresolved plugin don't play well with TinyBase's structure. It yells at me because it can't resolve some module with its resolver.

Your Example Website or App

https://github.com/cpojer/pnpm-eslint-tinybase-bug

Steps to Reproduce the Bug or Issue

It will show that it cannot resolve the paths.

Expected behavior

eslint should be happy with the custom paths.

Screenshots or Videos

No response

Platform

No response

Additional context

No response

jamesgpearce commented 6 months ago

Thanks for making it easy to repro! :)

jamesgpearce commented 6 months ago

So just to be clear, it seems to work fine with NPM and I'm wondering why PNPM puts things in a different place. Let me dig a bit more.

jamesgpearce commented 6 months ago

Wait what, no it doesn't. Repros in NPM too. The problem is no-unresolved not apparently understanding the export rules in package.json or something like that.

cpojer commented 6 months ago

Ah, should we file this against the eslint import plugin instead then?

jamesgpearce commented 5 months ago

https://github.com/import-js/eslint-plugin-import/issues/1810

jamesgpearce commented 5 months ago

It seems possible to maybe just touch empty files to keep the linter happy but that is such a hack. Until this is solved on the resolver side, it seems the best thing to do is document this issue in the Imports guide.

jamesgpearce commented 5 months ago

Documented in #7286a123f007ca9cd3953421d78093472a11c140 but I'll leave this open on the off-chance they fix it. exports should be pretty mainstream by now!

jamesgpearce commented 5 months ago

I'm hoping we are past these sorts of issues in v5.0.0-beta.21

If you get a chance could you give it a whirl please? Thanks!

image
cpojer commented 5 months ago

Yup, seems to work. Very nice, thank you.