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

Prettier format is geting overriden #6011

Closed
ShadabFaiz opened this issue Mar 27, 2019 · 2 comments
Closed

Prettier format is geting overriden #6011

ShadabFaiz opened this issue Mar 27, 2019 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken

Comments

@ShadabFaiz
Copy link

I'm working on an angular project. I have installed prettier (as extension on vscode and through npm also). I have created a .prettierrc.json and inclused these following options:

{
    "trailingComma": "es5",
    "tabWidth": 2,
    "semi": true,
    "printWidth": 75,
    "bracketSpacing": true,
    "endOfLine": "auto",
    "htmlWhitespaceSensitivity": "css",
    "insertPragma": false,
    "useTabs": false,
    "singleQuote": true,
    "parser": "typescript"
}

I have enabled vscode formatOnSave and Require .prettierrc, but i seems the once prettier is applied, vscode quickly reset the line to original format.

PrettierError

The above image is before formatting.

AfterManualFormat
This is the result if i run prettier through script. But when i save my code by pressing Ctrl+S,
code is getting reformatted to image 1.

@lydell
Copy link
Member

lydell commented Mar 27, 2019

A difference I see between your two images is the imports. That sounds like #5995

As a side not, it's generally an anti-pattern to include "parser" in your .prettierrc.json. See https://prettier.io/docs/en/configuration.html#setting-the-parser-docs-en-optionshtml-parser-option

Does this answer your questions?

@lydell lydell added the status:awaiting response Issues that require answers to questions from maintainers before action can be taken label Mar 27, 2019
@no-response
Copy link

no-response bot commented Apr 10, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Apr 10, 2019
@github-actions github-actions bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Oct 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. status:awaiting response Issues that require answers to questions from maintainers before action can be taken
Projects
None yet
Development

No branches or pull requests

2 participants