I have the same issue using VS Code for a NestJS + Mongoose server project. The same solution mentioned in several answers above, with a twist: Put it in the eslint.config.mjs` (extension can also be js
or whatever you are using for eslint.config.
Put the following in the `rules` object:
rules: {
...
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
...