Questions tagged [prettier-vscode]

121 questions
1
vote
0 answers

How to config prettier to format long lines

How can I config prettier to format long lines like this: return src(`${jsFolder}/libraries/*.js`, { since: lastRun(jsCopyTask) }) .pipe(dest(`${distFolder}/assets/js`)) And not like this: return src(`${jsFolder}/libraries/*.js`, { since:…
1
vote
0 answers

prettier-vscode is configured as formatter but it cannot format 'Json'-files

I'm unable to use prettier-vscode as a formatter for JSON files. It seems the extension does not register it as a valid default formatter. How can I fix it or is it bug? prettier-vscode is configured as formatter but it cannot format…
krema
  • 939
  • 7
  • 20
1
vote
2 answers

How to set up prettier on vscode for css modules

Prettier is formatting my module.css files strangely. Expected: .foo { @apply border-2 rounded } Actual (the first style is moved next to apply and a ; is added to the end .foo { @apply border-2 rounded; } All other files are formatted…
grabury
  • 4,797
  • 14
  • 67
  • 125
1
vote
2 answers

Prettier + VS Code. Printing semicolons on webpage after return statements (.js)

Prettier v8.1.0 out-of-the-box (no .prettierrc files) I am writing in .js files. Prettier is adding semicolon after return statements. These are showing up in my development environment webpages. --example return (
1
vote
0 answers

How to configure Prettier in VS Code to ignore comments for SQL code?

So the issue is illustrated as follows: Before using Prettier to format: SELECT * FROM table a --SELECT * FROM TABLE WHERE 1-1 And after using Prettier: SELECT * FROM TABLE a -- SELECT * FROM TABLE WHERE 1-1 How can I disable formatting for…
user49300
  • 21
  • 2
1
vote
1 answer

How can I get Prettier to Let Me Use Tabs

I'm using ESLint and Prettier with the AirBNB style guide. For the life of me I can't get it to stop yelling at me on every single line of my file to use spaces. .eslintrc.json { "env": { "browser": true, "es2021": true }, …
Justin
  • 945
  • 12
  • 26
1
vote
1 answer

VSCode formatting when it shouldn't be (prettier, javascript)

I've resolved almost all conflicts between ESLint and Prettier. However, I have recently ran into one that I am stumped on. const data = await userManager .getUsers() .orderBy('joinedDate', 'desc') .limit(20) .get(); I highly…
eduncan911
  • 17,165
  • 13
  • 68
  • 104
1
vote
2 answers

VS code adds semicolon to the end of an HTML line

I'm working in an Angular project. When I create a simple HTML template like:
some {{ text }}
VS Code adds a semicolon to the end of the line when saving, which is obviously not desired. when you delete and save again it adds it back…
Graham Fowles
  • 429
  • 1
  • 4
  • 12
1
vote
1 answer

Code formatter 'cannot format' JavaScript file

I am using Macbook and suddenly my Prettier in VSCode didn't work and show a message in the bottom bar like this: Here is my settings.json file: "editor.formatOnSave": true, "workbench.colorTheme": "Material Theme Darker", …
1
vote
0 answers

vscode Prettier not working after update vscode v1.53

I have been using vscode prettier for few months now. I always used it to auto format my codes with vscode shortcut Shift + Alt + F or type >Format Document in command palette But all of a sudden, vscode gave me this error this error msg: "invalid…
koonfoon
  • 433
  • 4
  • 12
1
vote
1 answer

Prettier for YAML - SyntaxError: Nested mappings are not allowed in compact mappings

In my project there is a YAML file for NewRelic newrelic.yml that has a line with Ruby code for setting app_name. The existing config is working, and I need to edit the file, but when I try to do a yarn commit it fail with the following error, that…
CanuckT
  • 321
  • 1
  • 3
  • 14
0
votes
1 answer

How can I make prettier put HTML/JSX attributes on the same line up to a specific length?

prettier do this auto newline setPostData({ ...postData, message: e.target.value })} /> what, i want like this can prettier…
0
votes
0 answers

Why isn't my prettier custom plugin working?

i am creating new Vscode extention using prettier custom plugin for formatting code as requirement, my whole code work properly even extension is running properly but my plugin file that i describe here can't print consol.log values like node and…
0
votes
1 answer

How to get ESLint/Prettier to underline errors in code in TypeScript for VS Code

I've installed ESLint and Prettier in my project folder, along with about every add on I could find to help solve the issue. I've also installed and enabled the extensions. However, I don't get any error warning in my files. For example, the…
0
votes
0 answers

Prettier ESLint - Can I force quotes to both avoidEscape and be consistent?

I have the array: ["R'", "L", "U", "D'", "F'", "B"] and it keeps getting formatted to use single quotes on only some of the values because the other ones have a literal single quote: ["R'", 'L', 'U', "D'", "F'", 'B'] I don't want to have…
Justin
  • 945
  • 12
  • 26