github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.51k stars 1.49k forks source link

LGTM.com - false positive #4466

Open jlhogan opened 3 years ago

jlhogan commented 3 years ago

Description of the false positive Types imported and used in typescript/React files are marked as un-used if they are only used as type parameters for generic components

URL to the alert on the project page on LGTM.com https://lgtm.com/projects/g/ctoec/data-collection/snapshot/1b1dfa85cb7f6e76b6747550af72294814ad33a3/files/client/src/components/Forms/Enrollment/Fields/EnrollmentEndDate.tsx?sort=name&dir=ASC&mode=heatmap#xd85da995851ae0fa:1

erik-krogh commented 3 years ago

You could use type-only imports (documented here) to indicate explicitly that DateInputProps is only used as a type.