Questions tagged [prettier]
Prettier is an opinionated code formatter for JavaScript, CSS, HTML, Markdown, and other languages. If possible, please use Prettier's Playground to illustrate your question (use the "Copy link" and "Copy markdown" buttons at the bottom right corner of the Playground).
prettier
1,696
questions
0
votes
1
answer
963
views
Flat config file with configs from legacy eslintrc compat error
I am trying to get prettier, typescript, eslint with airbnb typescript syntax working with linting and auto formatting.
The minimal node package.json file.
{
"name": "typescript-...
-2
votes
1
answer
77
views
Prettier formatting [closed]
When im formatting, it shows error
SyntaxError: Unexpected closing tag "a". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/...
0
votes
0
answers
22
views
prettier formatWithCursor very slowed when use with *.min.js
I have an issue:
Use prettier to format the min.js file content, but the problem is that prefromance takes a lot of time if used:
prettier.formatWithCursor(contentFileMinJS, {
parser: "babel"...
0
votes
0
answers
50
views
How can i solve "loading error module" for Prettier?
I tried adding Prettier to a random project to get familiar with the setup but after I installed the plugin I can't seem to get past this error, and I searched for hours.
(photo) prettier error ...
0
votes
0
answers
21
views
New Line in prettier when more then one attribute and content
i want to add config to not break line when length is less than printWidth property.
First Case
input:
<div b={2} a={2} b={3} c={22}>s</div>
output:
<div b={2} a={2} b={3} c={22}>
...
0
votes
1
answer
335
views
How to use 4 spaces formatting for indentation in VSCode for Volar through Vue - Official extension in .vue files?
I have a vuejs project and my team uses VSCode as the editor. I'm trying to setup a general project configuration for consistent autoformatting, including 4 space indentation instead of 2. I installed ...
0
votes
1
answer
83
views
Prettier Format Document
Have Prettier formating corretly but only when Ctrl+shift+p and selecting "Format Document With..." -> "Prettier - Coder formatter".
When selecting "Format Document" ...
1
vote
0
answers
455
views
In VSCode, is there an Angular component.html formatter with an option for spacing the new built-in control flow contents away from the block opening?
In Angular 17, built-in control flow syntax was added as a preferred component template feature.
This allows for sections of templates to change from something like:
<div *ngIf="condition; ...
1
vote
2
answers
75
views
Prettier automatically adds {" "}
When I try to formatting the below code with Prettier:
export default function App() {
return (
<View className="h-full flex flex-row justify-center bg-blue-500">
<View ...
0
votes
0
answers
75
views
I am creating a custom preprocess for prettier plugin, which rearrange the import order, but it is not working properly
The below was the preprocess I have created, I can see the reordering occurs and the conversation of the ast to code was also happening, but while saving the file the reordering was not happening. I ...
0
votes
0
answers
26
views
VS-code prettier extension removing perentheses
hello guys i need help with my code when i add perentheses prettier keeps on removing them, i did a little research and added .prettierrc in my root directory with the folloing:
{
"...
0
votes
0
answers
347
views
Issue: Replace `··` with `↹`eslintprettier/prettier
I'm getting an error: Replace ·· with ↹eslintprettier/prettier, but only in some cases, like here:
export const getTotalHabitableArea = (
checklist: FormattedChecklistType,
isFullChecklist: ...
1
vote
1
answer
81
views
Prettier insert blank line after list item in Markdown file
Currently the Prettier will format a Markdown file like this:
1. Example
```bash
$ cat dummy.txt
```
and insert a blank line after the list item like this:
1. Example
```bash
$ cat dummy.txt
```
I ...
0
votes
0
answers
64
views
Prettier formatter not working for .sol files, but works with .js, .css, etc
At the bottom of VS Code the prettier icon is a cross out icon when in a .sol file, but when I'm in other file types it's a checkmark.
Here's the error message I receive when I try to format the ...
0
votes
0
answers
30
views
Code formatting not working properly in prettier-eslint
I use prettier-eslint for code formatting in vscode. All major tags formatted succesfully when save. But some tags divide the tag and it's class to another code line. I won't to get the tag and class ...