Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of error: Delete `␍⏎` eslint (prettier/prettier), and allow use double `cr` Visual Studio Code1.56.2 on Windows 10

I want to use double ("carriage return" || "Enter" key) to visually separate code-sections, and start new chaining form separate line (even if line length less then 80char).

But get an error: Delete ␍⏎eslint (prettier/prettier)

my code snippet:

router.param("id", checkId) //middleware to validate id
`␍`
`␍`
router.route("/")`␍`
  .get(getAllTours)`␍`
  .post(checkBody, createTour)

router.route("/:id")`␍`
  .get(getTour)`␍`
  .patch(updateTour)`␍`
  .delete(deleteTour)
`␍`
`␍`
module.exports = router

Tried: .eslintrc.json

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

Answer form https://stackoverflow.com/a/53769213/15580822

and also try the same in my config .prettierrc

All of this did not help. I'm getting the same error continuously...

I do not want to disable prettier completely.

But setting "endOfLine" in .eslintrc.json** ("off" - Never automatically format embedded code.) completely disable warnings from prettier

{ 
'endOfLine': 'off',
}

My question: what it actually does? Do I disable prettier completely?

I can not find an answer here or Google...

Any thoughts how to get rid of this error and still use prettier?

like image 350
Denys Pugachov Avatar asked Dec 06 '25 03:12

Denys Pugachov


1 Answers

Answer is on the comments above, I had the same issue and after a bit of trial and error it was solved with:

On my .eslintrc.js

endOfLine: 'off'

And the .prettierrc.js

endOfLine: 'auto'

No more issues on the ESLint output, all works fine.

like image 72
Alex Lillo Avatar answered Dec 08 '25 19:12

Alex Lillo