Questions tagged [prettier-vscode]

121 questions
2
votes
1 answer

The prettier extension will use 'node_modules/prettier/index.js' for validation

I have Prettier extension installed in my VS Code. Up until the last update everything worked fine, and now I am prompted with this question: The Prettier extension will use 'node_modules/prettier/index.js' for validation, which is installed…
NeNaD
  • 18,172
  • 8
  • 47
  • 89
2
votes
4 answers

Update VSCOD Getting Error loading workspace folders

After upgrade every time I open VS Code I get a Error loading workspace folders and Even All the extension were not working go [-e -json -compiled=true -test=true -export=false -deps=true -find=false -- builtin ibm.com/cloudbroker/order/...]: exit…
1
vote
1 answer

how to use prettier-plugin-svelte with prettier-plugin-tailwindcss

I'm trying to use prettier to format svelte files with tailwind classes, so that tailwind utilities classes get automatically sorted following tailwind's recommended order I followed this docs: prettier-plugin-svelte with…
opensas
  • 60,462
  • 79
  • 252
  • 386
1
vote
1 answer

Problem when formatting Angular inline template on VSCode

I always have weird and non working formating when using inline template. Like this line: template: `
`, Is formatted to: template: `
Splinteer
  • 1,126
  • 4
  • 13
  • 28
1
vote
0 answers

Why prettier-plugin-tailwindcss does not sort my classes on my WordPress project

I don't know if the answer is pretty obvious or not, but I can't seem to make this prettier-plugin-tailwindcss : Automatic Class Sorting with Prettier work on any of my projects using PHP FILES / WordPress. I've installed the plugin and ran the…
maiakd
  • 160
  • 9
1
vote
0 answers

Is it possible to add empty line between sibling elements in VSCode using Prettier?

Desired behaviour => Before formatting After formatting
1
vote
1 answer

How to configure Prettier to only format files with specific extensions within a set of folders

I'm configuring Prettier in my React project and I'm having difficulties with the .prettierignore file. I'm passing the following instruction to it: /* !src/**/*.{ts,tsx} The idea was to make Prettier ignore all files and folders and then have it…
KernelDN
  • 17
  • 6
1
vote
1 answer

Is there a way to tell Prettier that the following "block" has a specific markup type?

I'm having issues using mjml where I want to specify inline CSS, but it's currently not supported by Prettier as far as I could tell. The only way I found how to bypass this is using but mjml is expecting this to be a CSS…
Nicolas Bouvrette
  • 4,295
  • 1
  • 39
  • 53
1
vote
1 answer

Prettier on VS Code unfolds my code blocks on save . How to prevetn sthis?

I'm using Prettier on VS Code with the editor.formatOnSave enabled. Every time I save my (js)|| (jsx) file and prettier runs it unfolds all my functions. Is there a way to prevent this from happening? I have a large React component and would like to…
1
vote
1 answer

Add new line between {} in JSX

If I write something like this: { factors.map((factor) => (
  • {factor}
  • )) } I've got something like this by prettier: {factors.map((factor) => (
  • {factor}
  • ))} Someone knows what rule I must add to avoid…
    dawalberto
    • 96
    • 5
    1
    vote
    2 answers

    How to adjust prettier in vs code for 4 spaces and tabs?

    I have the latest version of prettier on macos with latest vs code, but I still see 2 spaces on new tabs when I Format Document. This is a React/NextJS JSX document (also does with CSS). In the VS Code Prettier settings, I have the tabs set as true…
    cdub
    • 24,555
    • 57
    • 174
    • 303
    1
    vote
    2 answers

    How to get rid of eslint prettier errors

    How do I get rid of this replace error that underline red all over my code? Also everytime I "fix" all the errors, whenever I save, it show me the same error again.
    1
    vote
    0 answers

    How to setup flatTernaryExpressions in prettier VSCode?

    I have configured prettier for formatting documents in VSCode. When I format document, it formats like below function fun1(value: string): string { return ? "string1" : ? "string2" :…
    hi-ren
    • 66
    • 1
    • 5
    1
    vote
    0 answers

    Prettier breaks the import statement into two lines

    I am trying to prevent prettier from breaking my code. Current setup causes an import statement that is 125 characters long to break into 2 lines which results in an error. import DiagnosticsResponseMessageContainer from…
    ege
    • 812
    • 6
    • 16
    1
    vote
    0 answers

    Correct version of Node/ECMA for linting

    I'm using Prettier in VSCode, but it appears to be flagging mistakes that I think are ok. Specifically, if I test a variable like: if (myObject?.property1?.property2) { .... } (Not sure of the correct name for using questions marks like this)…
    user4893295
    • 533
    • 6
    • 25