Closed smorimoto closed 5 months ago
Types must come before the JS they describe.
But if the goal of any other type dialects here (such as source
) is to be able to tell typescript to resolve to it, then that can hardly be effective if typescript will match on types
first.
For the same reason, if you use the "types@>=5.4"
type of conditional to provide different types to different TS versions, then putting types
first would make that impossible.
So, no, this is incorrect. Publint is being overly persnickety on this, and there's no rational reason for it.
Ref: https://publint.dev/rules#exports_types_should_be_first