Questions tagged [prettier-vscode]

121 questions
0
votes
0 answers

Why does Prettier keep double indent my code

Sorry I understand Prettier is opinionated, but I was just hoping someone could explain to me the weird indenting it keeps adding to my CSS. Here's my code block before formatting .scan-control-block>button { min-width: 100px; …
Showcaselfloyd
  • 790
  • 7
  • 28
0
votes
1 answer

Multiple prettier config in one project in VSC

I have a project where I have tests and src of my code. I wish to use different prettier configs for tests and application sources, so VSC would do the formatting according to the folder i'm in. Is this possible ? Currently it's doesn't work for me,…
0
votes
0 answers

run npm run pettier:check

Run npm run prettier:check ilearning@0.0.0 prettier:check /home/runner/work/stack-ilearning/stack-ilearning prettier --check src/**/* Checking formatting... [warn] src/pages/trisha/style.css [warn] Code style issues found in the above file. Forgot…
0
votes
0 answers

prettier not working. Shows a danger symbol

enter image description here when Save the file it doesn't format the code. I did add prettier into the default formatter option. It worked fine for a day, now its not working at all, Please help me guys. And let me know what if you have any…
0
votes
1 answer

Why do I have a prettier newline warning on every single line?

The problem is I am getting a prettier error on every single line in my file. Prettier Screenshot I created a blank new Typescript file in an already existing code for a client and that's the only file with this issue. There's nothing wrong with any…
0
votes
0 answers

VS Code not allowing me to use format:modifications with Prettier format onSave mode 'modification'

I spent a lot time for investigate that problem. In some way prettier formats all page but not allow to use format:modifications. I have set up git to project, also format on save when format:file works well as i need. I didn't found explanation or…
Oleh21
  • 11
  • 3
0
votes
3 answers

How can I configure Prettier to preserve setext headings ("===") instead of converting them into ATX headings ("#")?

When I write a .md file with VS Code and I save, it automatically formats my code. While this is generally what I want, the formatting it uses bothers me. For instance, I like to have control over two things: I like to do my h1 titles using ===…
ling
  • 9,545
  • 4
  • 52
  • 49
0
votes
0 answers

How can I auto-format code on save in React project with Prettier and Tailwind CSS sorting?

I am new to react and I don't use prettier generally. I am trying to use the prettier on my react project along with the tailwindcss class sorting. I couldn't find a solution for my problem. I have checked out the format on save in VS Code. I have…
0
votes
0 answers

Can one configure Prettier to a more human-readable boolean expression formatting?

If I have a long boolean expression, even if it has nesting it's getting formatted with every variable on a new line followed by the operator. Which arguably makes it less readable to the human eye. What prettier gives me: private static Boolean…
Al Cher
  • 336
  • 3
  • 11
0
votes
0 answers

React Native: Prettier stopped underlining in VSCode

I'm on VSCode version 1.78.1 and React Native version 0.69.10. I have the ESLint and Prettier ESLint VSCode extensions both enabled globally. Previously they were working as expected, underlining linting errors in red, prompting for correction, etc.…
0
votes
0 answers

When I press save, prettier occured error

["INFO" - 오후 1:21:30] Formatting file:///Users/DSM20221/jikwan/github/Aliens/DMS/services/admin/src/utils/translate.ts ["INFO" - 오후 1:21:30] Using config file at '/Users/DSM20221/jikwan/github/Aliens/DMS/services/admin/.prettierrc' ["INFO" - 오후…
Jikwan
  • 21
  • 2
0
votes
0 answers

prettier-vscode extension: why did I solve 100% CPU usage with a wrong parameter?

I'd like to understand why is this happening... Using VS Code and dev container, I was having a frozen container at 100% CPU usage after a few minutes, and noticed it came from the Prettier extension. Prettier was pretty slow (around 500 ms on my…
0
votes
1 answer

How can I prevent Prettier from breaking a single line into multiple lines when closing tags in my code?

I want to keep my code like this:
But prettier changes it to:
Luc881
  • 1
  • 1
0
votes
0 answers

How to ask prettier to avoid new line with specific functions?

Prettier is awesome but it can be a handful sometimes. Consider the following piece of logic: body("name") .notEmpty() .withMessage("Name is required") .isLength({ min: 3 }) .withMessage("Name should be at least 3 characters long") …
p0lAris
  • 4,750
  • 8
  • 45
  • 80
0
votes
1 answer

configure the Prettier extension to use the locally installed Prettier?

When I press ctrl+s, the file gets formatted by the Prettier extension in VS Code. However, it seems to be slower when compared to the locally installed Prettier using npm install -g prettier. Please correct me if I am wrong. How can I configure the…