Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
-
I like the concept of adding an event for "beforeFormatCode" and "afterFormatCode" that will allow us to apply any formatter (e.g. non prettier) with any settings. However, I am not clear how it will work with multiple formatters (multiple plugins that implement the formatting event) and even how it will work between a single formatter and the "defaultBehaviour" formatting - since every formatter will likely override the previous formatter. Should we limit it to a single formatter plugin and to assume it always means "skipDefaultBehaviour" ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently
data-service-generator
contains logic to format with a consistent set of rules generated code files (here: https://github.com/amplication/amplication/blob/master/packages/data-service-generator/src/server/create-server.ts#L83).This behaviour works fine but it only format these files following the default set of prettier rules.
When a user select a
formatter
plugin, all the generated code should be formatted using the user's defined format function (i.e. for prettier plugin the function will be the prettierformat
with the configuration saved in the plugin settings).In order to do so, we will need to allow
formatter
plugins to define their specificformatCode
function that will be executed by dsg as per today.Beta Was this translation helpful? Give feedback.
All reactions