pzavolinsky / ts-unused-exports

ts-unused-exports finds unused exported symbols in your Typescript project
MIT License
738 stars 46 forks source link

Ignore getServerSideProps for Next.js codebases #217

Open dshook opened 2 years ago

dshook commented 2 years ago

Hi there, thanks for the work on this!

I'm wondering if there's a way to excluded the getServerSideProps and default exports for Next.js projects with its file based router.

You can of course exclude the whole file with something like ts-unused-exports tsconfig.json | grep -v getServerSideProps but this will miss any other unused exports from the files as well.

mrseanryan commented 1 year ago

hm sounds tricky!

For now, I'd disable such warnings with a comment:

// ts-unused-exports:disable-next-line
mon-jai commented 1 year ago

Maybe we can add a --excludeSignatureFromReport flag?