Open InamTaj opened 5 years ago
Try this
module.exports = (baseConfig, env, config) => {
// TypeScript support
config.module.rules.push({
test: /\.(ts|tsx)$/,
include: path.resolve(__dirname, '../src'),
use: [
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
},
},
{
loader: require.resolve('react-docgen-typescript-loader'),
options: {
propFilter: props => props.parent && props.parent.fileName.startsWith('ui/src'),
},
},
],
})
config.resolve.extensions.push('.ts', '.tsx')
return config
}
For me, props.parent
basename was ui/src
but it might be different for you, console.log to find out.
I have performed a pretty standard integration of
react-docgen-typescript-loader
but it shows me all of the inherited props of the function as well. I was able to filter almost half of the props with specifyingskipPropsWithoutDoc
option in the webpack loader config. Now I'm still being shown thearia-*
props which I need to skip. I tried placing regex in theskipPropsWithName
option but to no avail.Take a look:![image](https://user-images.githubusercontent.com/10061376/47998358-d85d5b00-e120-11e8-839e-ad8a8e5d41d5.png)
As for the filtering function, I have no idea how to specify both of my requirements (filter by regex and filter undocumented props) in the filtering function. Any ideas?
Tech Stack:
Thanks in advance for your help & time!