Code formatting: Use prettier? #9377
Labels
resolution:expired
This issue was closed due to lack of feedback.
status:stale
type:task
This issue reports a chore (non-production change) and other types of "todos".
What does the CKEditor dev team think of tools like prettier?
Provide a description of the task
Weigh the pros/cons of automated formatting in 2021 / current year
Solutions like prettier make the environment far different than they were before.
📃 Pros / cons
Pro: I think it automates consistent code style
Pro: Prettier is fast
Pro: Contributing for outside developer is easlier, less code style in regards to formatting. A machine does the work.
Pro: If ckeditor5 published a
@ckeditor/prettier-config
package (see Prettier: Sharing configurations, external projects like @wiris/mathtype-ckeditor5 and ckeditor5-math could use it and get formatting config updates downstream.Con: even the best formatter produces bad style - if prettier were ran on this codebase right now, I expect there'd be plenty of places where readability would decline (in the short term, at least)
Con: Some code styling things wouldn't be possible with prettier (or would require a custom plugin, and once those custom plugins get involved that's where I see friction usually since some editors ignore them and reformat the file, causing messy diffs)
Golang does this with
go fmt
and python has a formatter getting more popular: https://github.com/psf/black.Con: eslint and it's prettier plugin is very slow
Discussion
Any thoughts from CKEditor developers and contributors. What has / hasn't worked for you?
Also - have CKEditor developers tried sharing a branch with prettier and seeing if they liked it and it worked with their setups? Could they find a configuration that looked legible?
The text was updated successfully, but these errors were encountered: