Questions tagged [prettier]

Prettier is an opinionated code formatter for JavaScript, CSS, HTML, Markdown, and other languages. If possible, please use Prettier's Playground to illustrate your question (use the "Copy link" and "Copy markdown" buttons at the bottom right corner of the Playground).

Prettier is an opinionated code formatter.

You can use it to format JavaScript (including JSX, Flow, TypeScript, JSON), CSS (including Less, SCSS, CSS-in-JS), HTML (including Angular and Vue), GraphQL, Markdown, and YAML.

Try it out here: Prettier Playground.

1619 questions
0
votes
1 answer

How to show full WebStorm information in event log window of IntelliJ?

I have a git pre-commit, like this { "gitHooks": { "pre-commit": "lint-staged" }, "lint-staged": { "*.{js,jsx,less,md,json}": [ "prettier --write" ], "*.ts?(x)": [ "prettier --parser=typescript --write" ] …
lanker
  • 3
  • 1
0
votes
1 answer

Prettier to format string vars

I need a code editor to display and edit html code in my vue.js project. I have the html codes in DB and I need to format it before displays. I know prettier can do that with function prettier.format() but I am unable to achieve that. If any one…
0
votes
1 answer

Prettier - custom config option

how to made prettier to format my code in the way lika on a picture? Every time I save my code it is formatted to one line of code, but it's much more readable for me to keep it like on shared picture. EDIT: My .prettierrc: { "singleQuote":…
5ocjal
  • 13
  • 5
0
votes
1 answer

tslint and prettier conflict use tslint rules

I have prettier and tslint configured. However it seems prettier overrides the tslint rules. I can disable some of the rules using .prettierrc. However I'm still having issues. I want the tslint.json /exceptions to take precedence over…
MonteCristo
  • 1,471
  • 2
  • 20
  • 41
0
votes
1 answer

prettier-atom stopped working - single quote error

prettier-atom was working great with .js files, but after running it on a package.json file (auto-format on save was enabled) it stopped working and gave me the following error: "prettier-atom failed: Invalid singleQuote value. Expected true or…
Steve Silberberg
  • 277
  • 3
  • 18
0
votes
2 answers

Align indentation to the equal sign

I want to align the indentation to the equal sign when formatting my code. Is there any plugin or setup out there? Before: const React = require('react'); const MainContainer = require('../../components/container/main'); const HasAnyRole =…
0
votes
2 answers

VS Code changes the default format of my HTML

I don't really understand why VS Code changes the format of my HTML, I have already removed prettify. Any idea how to retain the format for the code that I've pulled? Because when I click save the format changes. This is the format of the code when…
user13094449
0
votes
2 answers

Visual Studio Code Prettier Extension Failing To Format Quotes Correctly For TypeScript

I am currently working with TypeScript in VS Code and I use Prettier code formatter to format my code. I have my setting configured to use single quotes on format for TS files, but when I format, all my single quotes get turned into double quotes.…
user8896580
0
votes
1 answer

How can i improve code formatting using prettier configuration

I am using prettier with vs code with the option "editor.formatOnSave": true Here is my .prettierrc config: module.exports = { semi: false, overrides: [ { files: ['*.js', '*.json', '*.css'], options: { …
Aziz.G
  • 3,599
  • 2
  • 17
  • 35
0
votes
1 answer

How to put tap space in my code while using prettier in vscode

Prettier is useful in most times. But, sometimes I want to put tap space in my code for enhanced reading of the code. Is there any way for put tap space in my code intentionally while using Prettier?
Mint Bee
  • 49
  • 1
  • 3
  • 10
0
votes
1 answer

Is it possible for ESlint autofix break my code?

I ran ESlint (with prettier plugin) on my repo and it showed about 700 problems, 600 of them it said it can autofix with the --fix flag. How should I approach this? Is it safe to autofix or it could break my code and I should do it manually one file…
Gambit2007
  • 3,260
  • 13
  • 46
  • 86
0
votes
0 answers

Eslint and prettier in typescript project - disable prettier error

I have tried all possible combinations of plugins and extends in .eslint so that it plays nicely with prettier. What I want is the editor (vscode) to not show prettier errors when writing code because I expect it to understand that there error will…
quantdaddy
  • 1,375
  • 4
  • 19
  • 29
0
votes
2 answers

What is the prettier file annotation for?

I have seen some React files that start with: /** * @prettier */ What is the intention of this?
Gambit2007
  • 3,260
  • 13
  • 46
  • 86
0
votes
2 answers

React Native error on double curly braces, ESLint/Prettier Warnings

I'm new to React Native and try to walk through a basic tutorial on official website. but when I finish the configuration this error come out. it seems like something to do with Prettier issue but I couldn't figure out why. This is the…
Byeonggil Park
  • 107
  • 3
  • 12
0
votes
0 answers

Problem formatting in VSCode with Prettier

textComp() { return this.props.GMarcha ? this.props.english ? 'On' : 'Encendido' : this.props.english ? 'Off' : 'Apagado'; } I have this function. When I use Prettier to format it it stays like this: textComp() { return…
1 2 3
99
100