I want to format the javascript file in /node_modules, prettier ignores the formatting. How to do it? Wanted to apply --with-node-modules, but don't know how
This isn't a flag that is exposed through the VS Code extension. This doesn't seem like something that is common enough to justify putting in the extension.
Please reopen if you have a strong opinion on this, but I think using the CLI is a valid work around.
Hey, turns out it might be useful if working with nested node_modules folder. Assuming .gitignore looks something like this and we use it as .prettierignore:
/node_modules
!/src/node_modules
prettier.getFileInfo is going to always return ignored: true if withNodeModules option is false. Providing withNodeModules: true correctly ignores files in the root node_modules folder and allows formatting in /src/node_modules.
I'm open to accepting a pull request with this feature.
Any momentum on this?
Need it too
btw, @sin-raben VSCode Beautify plugin may be worth your attention
As an interim solution I'd suggest to edit extension directly in the extensions folder: in dist/extension.js search for getFileInfo( and add withNodeModules: true there 馃し鈥嶁檪
thanks for the advice
Fixed in #1268
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed in #1268