bluwy / publint

Lint packaging errors
https://publint.dev
MIT License
932 stars 19 forks source link

wrong error for "main" #79

Closed ljharb closed 9 months ago

ljharb commented 9 months ago

I have a package, function-bind, that has "main" set to "index" - which node properly resolves to "index.js". However, I get:

pkg.main is index but the file is not published. Is it specified in pkg.files?
bluwy commented 9 months ago

Seems like it could be a bug detecting packed files locally. I'll have to check that once I get to my laptop.

ljharb commented 9 months ago

It seems like you're not using the node resolution algorithm on the main value before checking for the file's existence.

bluwy commented 9 months ago

I did https://github.com/bluwy/publint/blob/1c70d9ecffaefab572d2193d2a54da5461547135/pkg/src/index.js#L119-L122

I was checking the packed files wrongly that lead to the bug that's fixed in the commit.

ljharb commented 9 months ago

I doubt it's that simple, since another package has ./ and it wasn't working, but I'll test with this release.

bluwy commented 9 months ago

You can try with v0.2.5

ljharb commented 9 months ago

seems good, i haven't found one that breaks yet.