You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if we could manipulate the generated file in some ways, such as appending/or preprending code, or executing code after the generation with some kind of hook.
Use case :
The introspected file has
/* eslint-disable */
/* prettier-ignore */
appended to it, but I'm currently using another linter (dprint) that needs dprint-ignore. Currently I'm patching the internal package to add stuff there, but that's not ideal.
Proposed Solution
I haven't thought too much about it, but there's 2 things that could work :
Add a pre and post settings in the schemas property of the plugin, so we can pass abitrary code there.
This would be good for a simple use case. For example a linter use case you'd do something like this :
Add a beforeGeneration and afterGeneration hook, that will run a command with child_process.
This would be very flexible, for the linter use case it would allow to run a linter after each generation.
Summary
It would be great if we could manipulate the generated file in some ways, such as appending/or preprending code, or executing code after the generation with some kind of hook.
Use case :
The introspected file has
appended to it, but I'm currently using another linter (dprint) that needs dprint-ignore. Currently I'm patching the internal package to add stuff there, but that's not ideal.
Proposed Solution
I haven't thought too much about it, but there's 2 things that could work :
This would be good for a simple use case. For example a linter use case you'd do something like this :
child_process
.This would be very flexible, for the linter use case it would allow to run a linter after each generation.
Requirements
The text was updated successfully, but these errors were encountered: