OpenTechSchool-Leipzig / heimspiel

Your daily life in isolation - gamified #WirVsVirus
https://heimspiel.herokuapp.com/
1 stars 0 forks source link

Configure ESLint & Prettier integration #7

Open markusphil opened 4 years ago

markusphil commented 4 years ago

@Twissi , Ich hab mal ne vscode settings angelegt, die "formatting on save" disabled und "fix on save" enabled. Das lâst bei mir das Problem, dass prettier und eslint sich widersprechen! :D. Magst du einmal gucken, ob das bei dir auch passt? 😊

Twissi commented 4 years ago

@markusphil aber formatting on save enabled zu lassen macht eigentlich schon Sinn, weil wir dadurch die gleichen Formatierungen haben. Maybe we can put a vscode workspace setting file into the project so we have all the same settings when using vscode

markusphil commented 4 years ago

@Twissi Yeah, but in our current settup, eslint already enforces formatting rules - that's where some of our errors come from. Because somehow, at least for me, prettier autoformating is slightly differing from the eslint formating rules, though they are importet from that prettier-eslint integration setting thingy.

So I guess fix instead of format should also give us the same formatting, but builds without warnings 😊 . Of course we have to see how it behaves for different Systems. I already added the workspace settings πŸ˜‰

Twissi commented 4 years ago

~Seem to work for me~ although I am not 100% sure that eslint can replace prettier to 100%. πŸ€”

Update: Changed the formatting in a file and it did not update when hitting save.

Twissi commented 4 years ago

Right now I use for this project: (but i might have additional settings in my global settings.json)

{
  "editor.formatOnSave": false,
  "[javascript]": {
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.formatOnSave": true
  },
  "[vue]": {
    "editor.formatOnSave": true
  },
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "vetur.format.defaultFormatter.js": "prettier-eslint",
  "vetur.format.defaultFormatter.ts": "prettier-tslint",
}