After encountering this issue and investigating further, I discovered that the problem was related to my workspace setup, which included multiple projects. Here was my folder structure:

| ctx-frontend
--| .prettierrc
--| .prettierignore
| ctx-backend
--| .prettierrc 

The key issue was that I had opened Visual Studio Code at the root directory that contained both the ctx-frontend and ctx-backend folders. This configuration probably confused VSC when it came to determining which .prettierignore file to respect, as each project had its own Prettier configuration.

Solution:

To resolve this issue, I needed to open the ctx-frontend project directly in Visual Studio Code rather than the root directory. Doing this ensured that VS Code correctly identified and utilized the .prettierignore file for that specific project.

Answer from Neeko on Stack Overflow
🌐
Prettier
prettier.io › docs › ignore
Ignoring Code · Prettier
Use “prettier-ignore” comments to ignore parts of files.
Discussions

How to stop VSCode/prettier to stop formatting these to the same line on save?
My VSCode/prettier (not sure which is causing it) respects the new lines I create in my module.css file however another guy in my team has his css format to the 1 line. For consistency sake how can I get his to respect the new line? Tried looking at my settings.json, he updated his to be the same and no luck. More on reddit.com
🌐 r/vscode
9
0
January 24, 2025
"Prettier Ignore" entire File?
I work with code generation and some of it isn't conforming to my "prettier" settings. Instead of a huge diff where Prettier fixes it every time it's re-generated, is there/could there be a way to ignore an entire file? More on github.com
🌐 github.com
7
April 26, 2017
Support prettier-ignore-start/end for other languages (not only Markdown)
It seems this feature was added only for markdown (#4202 cc @ikatyang), but it's actually useful for other languages as well. It is not working on typescript files on my tests. Related: faceboo... More on github.com
🌐 github.com
75
October 23, 2018
`prettier-ignore-start` and `prettier-ignore-end` is ignored on html
Prettier 2.6.2 Playground link --parser html --no-semi --single-quote --no-bracket-spacing --bracket-same-line Input: More on github.com
🌐 github.com
1
April 8, 2022
🌐
GitHub
github.com › prettier › prettier › blob › main › .prettierignore
prettier/.prettierignore at main · prettier/prettier
# Ignore directories and files in 'tests/format' /tests/format/**/*.* # Unignore directories and 'format.test.js' file · !/tests/format/**/ !/tests/format/**/format.test.js · /tests/integration/cli/ !/tests/integration/plugins/automatic/node_modules/@prettier/plugin-foo/index.js ·
Author   prettier
🌐
Google Groups
groups.google.com › a › mozilla.org › g › firefox-dev › c › Ngac7mgzNzw › m › 3eAvmTJbAwAJ
PSA: Please use // prettier-ignore to disable Prettier formatting
April 3, 2023 - The reason for this change is that I am currently working on separating out Prettier from ESLint, so that they are run as separate processes. As part of this, we need to transition to use Prettier's ignore syntax rather than the syntax for ESLint.
🌐
Medium
medium.com › @popoever › use-prettier-ignore-to-solve-astro-vite-compiler-render-issue-57f1aef6e437
Use `prettier-ignore` to solve Astro/Vite compiler render issue | by Andre Pan | Medium
February 2, 2023 - By adding the <!-- prettier-ignore --> above the code block, which I want to keep what it is, Prettier skips the code block, no more ghost whitespaces.
Find elsewhere
🌐
npm
npmjs.com › package › prettier-ignore
prettier-ignore - npm
June 4, 2025 - Commonly ignore patterns for Prettier. Latest version: 0.4.0, last published: 10 months ago. Start using prettier-ignore in your project by running `npm i prettier-ignore`. There are 2 other projects in the npm registry using prettier-ignore.
      » npm install prettier-ignore
    
Published   Jun 04, 2025
Version   0.4.0
Author   hellozmj@qq.com
🌐
Prettier
prettier.io › docs › options
Options · Prettier
Prettier can allow individual files to opt out of formatting if they contain a special comment, called a pragma, at the top of the file. Checking for these markers incurs a small upfront cost during formatting, so it's not enabled by default. A file with the following as its first comment will not be formatted when --check-ignore-pragma is supplied:
🌐
Reddit
reddit.com › r/vscode › how to stop vscode/prettier to stop formatting these to the same line on save?
r/vscode on Reddit: How to stop VSCode/prettier to stop formatting these to the same line on save?
January 24, 2025 - Make him using the same prettier config file as you: https://prettier.io/docs/en/sharing-configurations ... what are you talking about. these are not CSS property declarations. they are utility classes being grouped together ... Increase printwidth to 100 or 120. ... Either you ignore entire file using .prettierignore or I believe you can also do something like eslint comments to describe disable it for the next line.
🌐
GitHub
github.com › prettier › prettier › issues › 1428
"Prettier Ignore" entire File? · Issue #1428 · prettier/prettier
April 26, 2017 - I work with code generation and some of it isn't conforming to my "prettier" settings. Instead of a huge diff where Prettier fixes it every time it's re-generated, is there/could there be a way to ignore an entire file?
Author   natdm
🌐
Devinschumacher
devinschumacher.com › how-to-disable-prettier-formatting-for-individual-files-or-folders
how to disable prettier formatting for individual files or folders | Devin Schumacher
August 27, 2022 - {/* prettier-ignore-start */} now you can write multi-line things and it wont format them! which is super helpful for things like snippets, cheats, etc. right? just make sure to add the closing comment line someday...
🌐
DEV Community
dev.to › clairecodes › ignoring-prettier-3pd1
Ignoring Prettier - DEV Community
April 14, 2019 - Exploring different ways in which you can get the Prettier code formatter to ignore sections of code and whether that is a good idea. Tagged with prettier, webdev, javascript.
🌐
Prettier
prettier.io › docs › cli
CLI · Prettier
It’s recommended to always make sure that prettier --write . only formats what you want in your project. Use a .prettierignore file to ignore things that should not be formatted.
🌐
GitHub
github.com › prettier › prettier › issues › 5287
Support prettier-ignore-start/end for other languages (not only Markdown) · Issue #5287 · prettier/prettier
October 23, 2018 - // prettier-ignore type A1 = string; // prettier-ignore type A2 = string /* prettier-ignore-start */ type B1 = string; type B2 = string /* prettier-ignore-end */ -type C1 = string; +type C1 = string type C2 = string
Author   brunolemos
🌐
GitHub
github.com › prettier › prettier › issues › 12989
`prettier-ignore-start` and `prettier-ignore-end` is ignored on html · Issue #12989 · prettier/prettier
April 8, 2022 - <!-- prettier-ignore-start --> <!-- SOMETHING AUTO-GENERATED BY TOOLS - START --> {% if ctx.translationKey %} {% set availableTranslation = [] %} {%- for lgg in ctx.site.languages -%} {#- set translatedUrl to the homepage of that language by default -#} {%- set translatedUrl = "/" + lgg.id + "/" -%} {#- set current language class -#} {%- set activeClass = "is-active" if lgg.id == ctx.locale else "" -%} {#- loop through all the content of the site -#} {%- for item in ctx.collections.all -%} {#- check matches -#} {%- if item.data|hasProperty('translationKey') and item.data.translationKey != '' a
Author   Dexus
🌐
Anthony Fu
antfu.me › posts › why-not-prettier
Why I don't use Prettier
September 30, 2022 - Increasing the printWidth only delays the circumstance and will affect other files that you didn’t touch. The only workaround you can do is to use // prettier-ignore, which to me, the "all or nothing" choice loses the point of using Prettier in the first place.
🌐
GitHub
github.com › prettier › prettier › issues › 4547
Ignore commonly generated folders · Issue #4547 · prettier/prettier
May 25, 2018 - At the moment, Prettier ignores node_modules/. In my experience, folders coverage and dist are commonly used to contain generated artifacts and could be ignored accordingly, as a sensible default. If someone really needs to include those...
Published   May 25, 2018
Author   astorije
🌐
Clairecodes
clairecodes.com › blog › 2019-04-13-ignoring-prettier
Ignoring Prettier · clairecodes
April 13, 2019 - If you really want Prettier to ignore a line of code, I suggest leaving a comment in your code explaining why.
🌐
Prettier
prettier.io › docs › install
Install · Prettier
node --eval "fs.writeFileSync('.prettierignore','# Ignore artifacts:\nbuild\ncoverage\n')"