๐ก Add option to ignore export names using a pattern
eugene-mohc opened this issue ยท 4 comments
Suggest an idea for this project
It would be useful to be able to ignore certain exports by pattern or regex matching. For example I like to always export the props type of a React component in its file. It may not be used anywhere else yet, but is conveniently there for the future and reduces git diffs.
This can somewhat be achieved using these settings:
{
"ignoreExportsUsedInFile": {
"type": true
}
}
However this prevents all other type exports from being reported as well, which is not ideal. The config could accept an array of patterns to ignore instead:
{
"ignoreExportsUsedInFile": {
"type": [".*Props"]
}
}
This would ignore only type exports which end with "Props", for example:
// Matches, OK // Not used, reported
export type { ComponentNameProps, SomeOtherType }
export { ComponentName }
Valid RFC. Would likely becomes regexes for ignoreExports
or ignoreExportTypes
(like ignoreBinaries
etc already do).
For now, you could add a simple preprocessor function to strip out anything unwanted.