Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier does not format in multi-folder repositories whilst using the .code-workspace config. #3385

Closed
aidanm1999 opened this issue Apr 27, 2024 · 3 comments
Labels
locked Please open a new issue and fill out the template instead of commenting. Stale

Comments

@aidanm1999
Copy link

Cannot re-open #3201, was marked stale as there was no response from contributors so was auto-closed. Please re-open.

@jameshearttech
Copy link

@aidanm1999 I thought I had the same problem, but I actually got it working just now. Maybe I can help you with your setup?

Summary

I'm building a monorepo with pnpm workspaces. I have prettier, a couple plugins, and a shared config in the root workspace (i.e., top level directory).

VS Code open to pnpm root workspace

["INFO" - 11:04:09 PM] Formatting file:///workspaces/test/prettier.config.mjs
["INFO" - 11:04:09 PM] Using config file at /workspaces/test/prettier.config.mjs
["INFO" - 11:04:09 PM] PrettierInstance:
{
  "modulePath": "/workspaces/test/node_modules/prettier/index.cjs",
  "importResolver": {},
  "callMethodResolvers": {},
  "currentCallMethodId": 5,
  "version": "3.2.5"
}
["INFO" - 11:04:09 PM] Using ignore file (if present) at /workspaces/test/.prettierignore
["INFO" - 11:04:09 PM] File Info:
{
  "ignored": false,
  "inferredParser": "babel"
}
["INFO" - 11:04:09 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 11:04:09 PM] Prettier Options:
{
  "filepath": "/workspaces/test/prettier.config.mjs",
  "parser": "babel",
  "arrowParens": "avoid",
  "printWidth": 100,
  "singleQuote": true,
  "trailingComma": "none",
  "bracketSpacing": true,
  "tabWidth": 4,
  "semi": true,
  "plugins": [
    "/workspaces/test/node_modules/.pnpm/[email protected]/node_modules/prettier-plugin-java/dist/index.js",
    "/workspaces/test/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prettier/plugin-xml/src/plugin.js"
  ]
}
["INFO" - 11:04:09 PM] Formatting completed in 230ms.

VS Code open using .code-workspace

["INFO" - 11:20:20 PM] Formatting file:///workspaces/test/apps/app1/package.json
["INFO" - 11:20:20 PM] Using config file at /workspaces/test/prettier.config.mjs
["INFO" - 11:20:20 PM] PrettierInstance:
{
  "modulePath": "/workspaces/test/node_modules/prettier/index.cjs",
  "importResolver": {},
  "callMethodResolvers": {},
  "currentCallMethodId": 2,
  "version": "3.2.5"
}
["INFO" - 11:20:20 PM] Using ignore file (if present) at /workspaces/test/apps/app1/.prettierignore
["INFO" - 11:20:20 PM] File Info:
{
  "ignored": false,
  "inferredParser": "json-stringify"
}
["INFO" - 11:20:20 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 11:20:20 PM] Prettier Options:
{
  "filepath": "/workspaces/test/apps/app1/package.json",
  "parser": "json-stringify",
  "arrowParens": "avoid",
  "printWidth": 100,
  "singleQuote": true,
  "trailingComma": "none",
  "bracketSpacing": true,
  "tabWidth": 2,
  "semi": true,
  "plugins": [
    "/workspaces/test/node_modules/.pnpm/[email protected]/node_modules/prettier-plugin-java/dist/index.js",
    "/workspaces/test/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prettier/plugin-xml/src/plugin.js"
  ]
}
["INFO" - 11:20:20 PM] Formatting completed in 104ms.
["INFO" - 11:20:46 PM] Formatting file:///workspaces/test/apps/app2/pom.xml
["INFO" - 11:20:46 PM] Using config file at /workspaces/test/prettier.config.mjs
["INFO" - 11:20:46 PM] PrettierInstance:
{
  "modulePath": "/workspaces/test/node_modules/prettier/index.cjs",
  "importResolver": {},
  "callMethodResolvers": {},
  "currentCallMethodId": 9,
  "version": "3.2.5"
}
["INFO" - 11:20:46 PM] Using ignore file (if present) at /workspaces/test/apps/app2/.prettierignore
["INFO" - 11:20:46 PM] File Info:
{
  "ignored": false,
  "inferredParser": "xml"
}
["INFO" - 11:20:46 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 11:20:46 PM] Prettier Options:
{
  "filepath": "/workspaces/test/apps/app2/pom.xml",
  "parser": "xml",
  "arrowParens": "avoid",
  "printWidth": 100,
  "singleQuote": true,
  "trailingComma": "none",
  "bracketSpacing": true,
  "tabWidth": 4,
  "semi": true,
  "plugins": [
    "/workspaces/test/node_modules/.pnpm/[email protected]/node_modules/prettier-plugin-java/dist/index.js",
    "/workspaces/test/node_modules/.pnpm/@[email protected][email protected]/node_modules/@prettier/plugin-xml/src/plugin.js"
  ]
}
["INFO" - 11:20:46 PM] Formatting completed in 93ms.

Copy link

github-actions bot commented Jul 2, 2024

This issue has been labeled as stale due to inactivity. Reply to keep this issue open.

@github-actions github-actions bot added the Stale label Jul 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
Copy link

github-actions bot commented Oct 8, 2024

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.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Oct 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting. Stale
Projects
None yet
Development

No branches or pull requests

2 participants