unusedExports: true with the no-unused-modules rule should never report files that are exported as the main file (main, browser or bin fields in package.json). What do you think?
That sounds like a good enhancement, no need for it to be behind an option, even.
What package.json should be used for this purpose?
src in the rule options (if existing) orFor a given file, the closest package.json to it, that has a main, does not have private true, and points to it, marks it as used.
Thanks for implementing this @ljharb! :tada:
Thank @rfermann :-)