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 set commas in prettier vs code

I have css file. I want to set prettier vs code so that after writing a comma, the selector I wrote remained in line with the previous selector. But when i save the file, the selector will be entered to next line I want to save the code like this…
0
votes
1 answer

How can I customize Prettier setting using WebStorm IDE without installing package

How can I export all Prettier linter setting from Visual Studio Code and using that in WebStorm? I am the only person from team that use WebStorm as programming IDE and not Visual Studio Code. Lots of linter Prettier setting required from Visual…
jacobcan118
  • 7,797
  • 12
  • 50
  • 95
0
votes
1 answer

ESLint/Prettier/Airbnb : Do I set them up again for each project?

I have just finished setting up Eslint/prettier/airbnb by watching an online tutorial but what I don't understand is that when I start a new project, will I need to repeat the same processes* again? I wish there was a way to integrate it to VSCode…
B_12
  • 143
  • 1
  • 9
0
votes
1 answer

Weird Vue linter behavior: "123 {{ v }} 123" within H2 multi-line tag caused error

I just setup my development environment, with the newly installed linter & prettier for Vue.js & NUXTJS I've checked my configuration with npx eslint --print-config ./pages/index.vue | npx eslint-config-prettier-check and No rules that are…
PlusA
  • 545
  • 1
  • 6
  • 15
0
votes
1 answer

can vscode extension prettier do the string padding?

I want the following effect for the import path. Can prettier do it? import a from "a" import bbbbbbbbbbbbbbbb from "b" import c from "c"
asservir
  • 53
  • 1
  • 6
0
votes
0 answers

Prettier in vscode using different multiline indentation settings than `prettier.config.js`

My project has a prettier.config.js. My colleagues and I use prettier, and format documents on save. On my machine, but not my colleague's machines, saving files changes the indentation for multiline code (function arguments, objects, etc). See…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
0
votes
1 answer

PhpStorm Code Folding show first line for folded HTML section

Is it possible to see the first line of the folded HTML section with PhpStorm? I want to fold following example HTML section:
ruslansteiger
  • 462
  • 1
  • 8
  • 21
0
votes
0 answers

Vim Prettier Plugin causing errors in file ending with .js extension

I have been mainly using vim to code in Java and everything works great. Recently I've tried to code in JavaScript however vim appears to be having some issues. It is because of the prettier plugin which I have recently included (java works well…
0
votes
1 answer

es lint --fix only supresses the error and doesnt fix

Trying to solve linting issues installed npm eslint in vs code editor ,then tried eslint --fix but es lint --fix only supresses the error and doesnt fix it completely,is there any npm command or a way to fix all the linting errors ,apart from…
Puja
  • 101
  • 3
  • 14
0
votes
0 answers

How to configure vue project with custom configuration for prettier and eslint using vscode

When I save the project into VSCode I'm getting wrong break like into html tags, how to solve it? The error is explaned into the code / images down. That is the non formated html.
0
votes
0 answers

VSCode Format on Save changes quotes

When I save I the quotes are changing from backticks -> ´ <- (this one the other way around) to ". From: module.exports = { siteMetadata: { title: `Gatsby Default Starter`, description: `Kick off your next, great Gatsby project with this…
Jan
  • 12,992
  • 9
  • 53
  • 89
0
votes
1 answer

Prettier Extension adding double brackets to if statement

I have my Prettier extension set to make my code prettier on save. It works amazing 99% of the time... However: If I type If (x = 14) {}; my prettier extension in VsCode will change it to if ((x=14)) {}; which will cause nothing to work. I have…
user13082757
0
votes
2 answers

ESLint / Prettier / Husky indent problems in React-Native app

I have a problem, when I commit, I have Husky which checks for indentation errors / usual errors (like props are not used.... etc). My app is a TypeScript React-Native app. I am getting the following: 25:1 error Expected indentation of 4 spaces…
r00t -
  • 225
  • 1
  • 2
  • 12
0
votes
0 answers

Prettier changing only one syntax element

In the following code, if I remove // prettier-ignore, then prettier will transform 'Accept' into Accept Which will generate a compilation error. Prettier doesn't do that on my other headers. Is there a better solution to this than asking prettier…
stKKd
  • 444
  • 1
  • 5
  • 11
0
votes
1 answer

Why npx does not work for some of the packages?

npx eslint This works fine and executes eslint with out the explicit cli install on the other hand, npx prettier-eslint This one does not work. //command not found But if I install prettier-eslint-cli above command works fine My question is why npx…
Ankur Marwaha
  • 1,613
  • 2
  • 15
  • 30
1 2 3
99
100