Try setting the "endOfLine":"auto" in your .prettierrc (or .prettierrc.json) file (inside the object)

Or set

'prettier/prettier': [
  'error',
  {
    'endOfLine': 'auto',
  }
]

inside the rules object of the eslintrc file.

If you are using windows machine endOfLine can be “crlf” basing on your git config.