All Questions
Tagged with prettier visual-studio-code
670
questions
1
vote
1
answer
20
views
How do you stop Prettier in VS code splitting CSS Selectors into multiple lines?
I want the code to look like this:
h1,h2,h3,h4,h5 {
font-weight: 400 !important;
}
But Prettier - Code Formatter is breaking each selector into individual lines:
h1,
h2,
h3,
h4,
h5 {
font-weight: ...
0
votes
0
answers
8
views
VSCode Arrow key function bug in react
Everytime i wrote code like this it makes my vscode lag.
<button type="button" onClick={() =>}>Click me</button>
I was always stuck or lag after the greater than key. Any ...
1
vote
0
answers
49
views
How to Prevent Prettier from Formatting C++ Macros into a Single Line?
I'm encountering an issue where Prettier automatically reformats my C++ macros into a single line, even though I've tried using the // prettier-ignore directive. Here's an example of my code:
`// ...
1
vote
0
answers
31
views
Is there any prettier rule for 'inserting spaces after opening and before closing parenthesis'?
I can achieve this in vscode by using:
{
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": true,
"typescript.format....
-1
votes
0
answers
30
views
How to enable Prettier "Format On Save" behaviour in VSCode for one source code type only?
I want to enable the Prettier (code formatter) format on save feature, but for one type of source file only. (One programming language source.)
In this particular case, I only want this featured ...
1
vote
0
answers
70
views
Prettier in VSCode - Fails to format files
I get the follow error log while formatting the typescript file. I am using VSCode with formatting snippet extension.
I have checked the doc, but cannot find any solution.
["ERROR" - 12:32:...
0
votes
0
answers
33
views
ReactJS Prettier : Place Types On New Line
I am getting this error in VSCode ReactJS Typescript Prettier:
Prettier is suggesting increases readability when dealing with complex or long generic types by placing the generic type on a new line, ...
0
votes
2
answers
65
views
How to sort React attributes in VS Code?
For example I got:
<Image
alt=""
src="/img/logo.svg"
width="30"
height="30"
className="d-inline-block align-top"
/>
Any plugin to sort ...
0
votes
0
answers
19
views
Vscode does not format the content of nextjs into multiple lines
vscode does not format the content of nextjs into multiple lines
I expected
<Image
alt=""
src="/img/logo.svg"
width="30"
height="30"
className="d-...
1
vote
1
answer
118
views
Why do I get an "Incorrect type" error when setting codeActionsOnSave?
I am following this doc by Wes Bos to set up both ESLint. I also wanted to make it such that the set up automatically helps me reformat my code on save. However, this part of the set up is not working....
0
votes
1
answer
31
views
Prettier included in package.json but not available in default formatter selection list
In an Angular project that I'm developing in Visual Studio Code, I have the following in package.json:
"devDependencies": {
"@angular-builders/custom-webpack": "^17.0.0&...
0
votes
1
answer
25
views
Prettier formatting remove the space after comma in SQL
I have this query:
SELECT
column1,column2,column3
FROM
table_stage
Then I set prettier to put the comma before the value but I get this result:
SELECT
column1
, column2
, column3
...
0
votes
0
answers
27
views
gap within the brackets in css in VScode
It seems that Prettier is not removing gaps in my Brackets {} in CSS in VSCode latest Version.
I thought in the past it use to do it, not sure though. It formats in all other respects except removing ...
0
votes
1
answer
233
views
How to configure ESLint with Prettier and TypeScript on Node 20?
I tried to configure Prettier with ESLint and create a configuration in settings.json to fix errors when saving, but the errors appear in .js files and not in .ts files. How to configure this?
...
0
votes
1
answer
160
views
VS Code: The Svelte server crashed 5 times. Cannot find module @rollup/rollup-win32-x64-msvc
Happens when saving and Prettier tries to format the code. Can anyone help me with this error? It's driving me insane.
Here's the error log:
Error: Cannot find module @rollup/rollup-win32-x64-msvc. ...