bluwy / publint

Lint packaging errors
https://publint.dev
MIT License
950 stars 21 forks source link

Respect typesVersion field #42

Open bluwy opened 1 year ago

bluwy commented 1 year ago

See https://github.com/faker-js/faker/pull/1966

typesVersion remaps the types path and should be taken into account when checking if the file exists.

bluwy commented 1 year ago

Initial attempt at https://github.com/bluwy/publint/tree/fix-typesVersion

bluwy commented 1 year ago

Published v0.1.13 with a patch to ignore the error for now if "typesVersions" exist. Might return in making the resolution work again in the future, so leaving this open.

phryneas commented 5 months ago

Just wanted to jump in here and also give a +1 on this - we'd be very interested to see the FILE_DOES_NOT_EXIST check applied to the types and typesVersions field.

Right now we have to keep our own hand-written tool on top of publint, and would be very happy if we could drop that :)

(Adding publint to the repo over in https://github.com/apollographql/apollo-client-nextjs/pull/264 in case you're tracking the libraries using it 😄 )

bluwy commented 5 months ago

Awesome! IIRC the resolver for typesVersion was really complex and not comprehensively documented, and it was hard to portray an error for multiple specified TypeScript versions. But otherwise if anyone (or me in the future) would like to contribute this fix, that would be great.