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

formatting differently than VSCode format on save #121

Open
sgehrman opened this issue Feb 3, 2021 · 4 comments
Open

formatting differently than VSCode format on save #121

sgehrman opened this issue Feb 3, 2021 · 4 comments

Comments

@sgehrman
Copy link

sgehrman commented Feb 3, 2021

On some files, I lint, format and save in VSCode, but then on push, husky runs pretty-quick and formats some files differently that make it fail the eslint check on push that comes after it when it checks the prettier rules.

@f0urfingeredfish
Copy link

I ran into a similar issue. I think the problem is with the VS Code Prettier extension resolving your prettier config file. Prettier uses cosmic config which allows you to define your prettier config in lots of ways. However prettier-vscode is only looking for .prettierrc or .editorconfig config files. So if you aren't using one of those prettier-vscode falls back to their settings. I fixed this by configuring prettier with a .prettierrc file.

@f0urfingeredfish
Copy link

Well it looks like it should support more config formats https://github.com/prettier/prettier-vscode/blob/3c80018d69fa129fed638f624404e728870e4a90/src/PrettierEditService.ts#L32 but I had issues when it was defined as a prettier.config.js file

@flybayer
Copy link

This might be the same thing as #95

@JounQin
Copy link
Member

JounQin commented Jan 16, 2024

Not sure to understand what's the issue.

A minimal but runnable online reproduction is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants