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

Different formatting with respect to prettier-eslint-cli for Typescript #891

Closed
julioolvr opened this issue Aug 2, 2019 · 2 comments
Closed
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@julioolvr
Copy link

Here's a repo reproducing this issue https://github.com/julioolvr/vscode-prettier-repro

Given this code, this is the way VScode with this plugin formats it:

function thisIsAFunction({
  thisIsAVeryLongArgumentName,
  thisIsAnEvenLongerArgumentName
}: {
thisIsAVeryLongArgumentName: number;
thisIsAnEvenLongerArgumentName: number;
}) {
  console.log(thisIsAVeryLongArgumentName);
  console.log(thisIsAnEvenLongerArgumentName);
}

Here's the output that prettier-eslint-cli generates (run npm run prettier in the given repo)

function thisIsAFunction({
  thisIsAVeryLongArgumentName,
  thisIsAnEvenLongerArgumentName
}: {
  thisIsAVeryLongArgumentName: number;
  thisIsAnEvenLongerArgumentName: number;
}) {
  console.log(thisIsAVeryLongArgumentName);
  console.log(thisIsAnEvenLongerArgumentName);
}

Notice the indentation in the type definition of the function argument. The eslint extension on vscode complains about it correctly. Relevant vscode config:

{
  "prettier.eslintIntegration": true,
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

Let me know if there's anything else you need from my side (or if you can't reproduce it, I couldn't find anything on my specific vscode config that causes this but maybe I'm missing something).

@ntotten
Copy link
Member

ntotten commented Aug 24, 2019

Due to the huge amount of bugs, linting support has been deprecated in version 2.0.0. See the documentation on the recommended configuration: https://github.com/prettier/prettier-vscode#vscode-eslint-and-tslint-integration

See #870 for more details.

@ntotten ntotten closed this as completed Aug 24, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

2 participants