Closed rkostrzewski closed 5 years ago
Thank you for the pull request! I'm looking things over.
Adding this here for my reference:
For reference, adding this option to the loader causes the prop disabled
to be filtered.
Thanks again for the pull request. This has been published as 2.2.0
.
Thanks :) and thanks for the awesome library
react-docgen-typescript
allows users to specifypropFilter
option as either an object withskipPropsWithName
andskipPropsWithoutDoc
or as a function for dynamic filtering of props. Currentlyreact-docgen-typescript-loader
allows us to specify onlyskipPropsWithName
andskipPropsWithoutDoc
.This PR adds the ability to specify the filter function in loader options to have more control over which props are documented. I've tried to make the change without breaking changes (and that's why there are 3 fields:
propFilter
,skipPropsWithName
, andskipPropsWithoutDoc
).This change is mainly to support https://github.com/styleguidist/react-docgen-typescript/pull/111 if it gets merged which would allow us to filter props by the place where they were declared (e.g. ignoring React.HTMLAttributes) which would solve https://github.com/strothj/react-docgen-typescript-loader/issues/20