Open joshuayoes opened 7 months ago
hey @joshuayoes,
I am thinking of picking up this issue. I wanted to discuss with you before proceeding.
are we thinking in the direction of creating a shared configuration package for prettier and then consuming that in all the lib workspaces?
@balindam yes, that was how I was imagining it, that would be great
@joshuayoes while solving the above issue, I found that the .prettierignore
file at the root directory applies to sub-directories as well. Then why were we copying the same .prettierignore
file to sub-directories in the first place?
Since the format:write
and format:check
jobs run in each workspace via nx, the prettier cli needs a .prettierignore
file in the actual workspace directory. As far as I can tell, the prettier cli does not have a way to pass an option to look somewhere for an ignore file, like we can do with config files, so at the time it seemed easiest to copy the files to keep them in sync. It's not the most elegant solution, I would be open to other options.
Currently, there is a lot of copy and paste in our prettier config across workspaces.
We also have a script to copy and paste a
.prettierignore
file into all the workspaces https://github.com/infinitered/reactotron/blob/909427ed20ec271b3f0696c0ccbb20d7be1aebd7/scripts/copy-prettier-ignore.mjsWe should simplify it by creating one config as a workspace and then consume it in all the lib workspaces.