Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ESLint & Prettier integration #7

Open
markusphil opened this issue Mar 27, 2020 · 5 comments
Open

Configure ESLint & Prettier integration #7

markusphil opened this issue Mar 27, 2020 · 5 comments
Labels

Comments

@markusphil
Copy link
Contributor

No description provided.

@markusphil
Copy link
Contributor Author

@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
Copy link
Contributor

Twissi commented Apr 4, 2020

@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
Copy link
Contributor Author

@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
Copy link
Contributor

Twissi commented Apr 11, 2020

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
Copy link
Contributor

Twissi commented Apr 17, 2020

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",
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants