Not formatting monorepo
See original GitHub issueThe formatter seems not to be working with monorepo!
I have three mono repo in a project (i.e. landing
, servers
, and studio
), the landing
dir is a Next.js app, while the servers
dir contains multiple servers which are Nest.js apps, and finally, the studio
dir is a Svelte (SvelteKit) app. If the working directory is the root/project folder prettier works perfectly on the landing
and servers
dir, and other files in the studio
dir except for the .svelte
files but the formatter works with .svelte
files if the working directory is studio
itself.
And my PC lag if I have multiple vscode instances running with other heavy applications (i.e. Docker, Firefox, Postman, etc)
What am I doing wrong!?
System info:
- OS: Ubuntu 22.04
- CPUs: Intel® Core™ i5-6300U CPU @ 2.40GHz (4 x 2500)
- GPU Status: 2d_canvas: unavailable_software canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software webgpu: disabled_off
- Load (avg): 1, 0, 0
- Memory (System): 7.65GB (2.55GB free)
- Process Argv: --no-sandbox . --crash-reporter-id 93055eb6-6fd7-4a64-90ee-21296107114f
- Screen Reader: no
- VM: 0%
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
prettierignore not working correctly in mono repo project #95
Hi, I have an issue that is similar to #14 My project folder structure is: root/ .git webapp/ package.json .prettierignore index.js foo/ ...
Read more >What is monorepo? (and should you use it?) - Semaphore CI
A monorepo is a version-controlled code repository that holds many projects. While these projects may be related, they are often logically ...
Read more >How to move your git repository into a monorepo without ...
Lets go over the script line by line. First we export all commits as a single patch file using git format-patch. The option...
Read more >Improve Git monorepo performance with a file system monitor
Git's new builtin file system monitor makes it easy to speed up monorepo performance.
Read more >The Ultimate Guide to TypeScript Monorepos
By declaring these in one central folder, dependencies do not need ... Prettier is a great tool for maintaining consistent formatting in a ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@phcoliveira solution didn’t work for me but I found a working alternative.
.prettierrc
toprettier.config.cjs
plugins: [require('prettier-plugin-svelte')]
Here’s the default
.prettierrc
(as generated fromnpm create svelte@next
) translated into JS:@jsxclan, @jerebtw, @ItzaMi and @toqueteos, I had some problems in configuring prettier in my monorepo setup. But I fixed them with this setting
pluginSearchDirs
. Take a look at my prettier config, which is at the root of the package:apps/client
, hence the value of../../
, because NPM installed the plugin at the root of the monorepo.I hope it helps.