I’m encountering an issue with Prettier after upgrading from version 3.2.5 to 3.3.0 in my Nx monorepo. Despite having a .prettierignore file configured to ignore certain directories, Prettier is now checking files in the .nx/cache directory, which it should be ignoring.
Checking the release notes
Project setup:
my-project/
│
├── .prettierignore
├── package.json
├── apps/
│ └── ...
├── packages/
│ └── ...
└── .nx/
└── cache/
└── ...
my .prettierIgnore:
/dist
/coverage
/.nx/cache
my scripts:
{
"scripts": {
"prepare": "husky install",
"format": "prettier --write 'apps/*/src/**/*.{js,jsx,ts,tsx,scss,css}' 'packages/*/src/**/*.{js,jsx,ts,tsx,scss,css}' '**/*.{json,md,yml}'",
"check-format": "prettier --check 'apps/*/src/**/*.{js,jsx,ts,tsx,scss,css}' 'packages/*/src/**/*.{js,jsx,ts,tsx,scss,css}' '**/*.{json,md,yml}'",
"lint": "eslint 'apps/*/src/**/*.{js,jsx,ts,tsx}' 'packages/*/src/**/*.{js,jsx,ts,tsx}' --quiet",
"pre-push": "yarn check-format"
},
"lint-staged": {
"apps/*/src/**/*.{md,css,js,ts,tsx,json}": [
"prettier --write"
]
}
}
when i run the script i see:
.nx/cache/13577657558843344516/outputs/apps/myApp/public/page-data/myPrivatePage/page-data.json 190ms
but this should not be here and was not there until I moved from 3.2.5 to 3.3.0.
Does this make any sense to anybody? it does not to my since its a minor version change but any hint would be appreciated
Steps Taken:
Verified .prettierignore:
Ensured the .prettierignore file is at the root and properly configured.Debugging Prettier:
Ran Prettier with the –loglevel debug option to see detailed output.