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

VS Code Integration Unclear #135

Closed
Dimomir opened this Issue Oct 24, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@Dimomir

Dimomir commented Oct 24, 2017

Hi I was wondering if you could provide some clarification on integrating prettier-eslint with VS Code.

I can find Prettier on the VS Code marketplace where it states

prettier.eslintIntegration (default: false) - JavaScript and TypeScript only

Use prettier-eslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from eslint rules.

However when I look through the README of prettier-eslint I don't seem to understand how I can integrate prettier-eslint into VS Code.

Is it possible that I have it autoFixOnSave with prettier and then have the result passed through to eslint?

Also does it autoFormat JSX files too?

Thank you for your time and help!

@azz

This comment has been minimized.

Show comment
Hide comment
@azz

azz Oct 24, 2017

Member

"prettier.eslintIntegration": true will tell prettier-vscode to use its bundled version of prettier-eslint to do the formatting, so you've found the right setting.

Is it possible that I have it autoFixOnSave with prettier and then have the result passed through to eslint?

If you also set "editor.formatOnSave": true, then it will do exactly that.

Also does it autoFormat JSX files too?

Sure does!

Member

azz commented Oct 24, 2017

"prettier.eslintIntegration": true will tell prettier-vscode to use its bundled version of prettier-eslint to do the formatting, so you've found the right setting.

Is it possible that I have it autoFixOnSave with prettier and then have the result passed through to eslint?

If you also set "editor.formatOnSave": true, then it will do exactly that.

Also does it autoFormat JSX files too?

Sure does!

@Dimomir

This comment has been minimized.

Show comment
Hide comment
@Dimomir

Dimomir Oct 24, 2017

Hi @azz
thank you for your prompt response!

So to iterate, the steps to get Prettier-vscode extension working with prettier-eslint on VS Code are:

  • install Prettier VS code plugin
  • npm install --save-dev prettier-eslint
  • Go into VS Code settings and set "prettier.eslintIntegration": true

Did I get this right?

Dimomir commented Oct 24, 2017

Hi @azz
thank you for your prompt response!

So to iterate, the steps to get Prettier-vscode extension working with prettier-eslint on VS Code are:

  • install Prettier VS code plugin
  • npm install --save-dev prettier-eslint
  • Go into VS Code settings and set "prettier.eslintIntegration": true

Did I get this right?

@azz

This comment has been minimized.

Show comment
Hide comment
@azz

azz Oct 24, 2017

Member

The VS code plugin bundles it in so you don't need to install it, but yes.

Member

azz commented Oct 24, 2017

The VS code plugin bundles it in so you don't need to install it, but yes.

@Dimomir

This comment has been minimized.

Show comment
Hide comment
@Dimomir

Dimomir Oct 24, 2017

Thank you!
Apart from the above just for anyone else that might stumble upon this, I also included
"editor.formatOnSave": true, in my User Settings in VS Code and it all works 👌

Awesome work guys

Dimomir commented Oct 24, 2017

Thank you!
Apart from the above just for anyone else that might stumble upon this, I also included
"editor.formatOnSave": true, in my User Settings in VS Code and it all works 👌

Awesome work guys

@Dimomir Dimomir closed this Oct 24, 2017

@HaoyangFan

This comment has been minimized.

Show comment
Hide comment
@HaoyangFan

HaoyangFan Jul 17, 2018

Hi I just want to confirm that as long as I have installed the VSCode Plugin for Prettier and set "prettier.eslintIntegration": true in User Setting, and also turns on the formatOnSave option on?

Do I need to add anything to my eslintrc as well?

HaoyangFan commented Jul 17, 2018

Hi I just want to confirm that as long as I have installed the VSCode Plugin for Prettier and set "prettier.eslintIntegration": true in User Setting, and also turns on the formatOnSave option on?

Do I need to add anything to my eslintrc as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment