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
1,696
questions
10
votes
6
answers
17k
views
Prettier is not working at React project
I am migrating my airbnb eslint rules to prettier rules, but I'm having some issues.
Here is my .eslintrc:
{
"parserOptions": {
"ecmaVersion": 6
},
"env": {
"browser": true,
"node":...
3
votes
2
answers
2k
views
Atom with prettier, eslint and airbnb style guide for React development
Does anyone know how to properly setup eslint with prettier in Atom editor?
I wanted to use airbnb presets, but when I check ESlint integration in prettier settings, after I save my file, I have ...
3
votes
1
answer
1k
views
How can i get Prettier and ESLint to work together?
When using Sublime Text 3, how can I get the both to work together?
On file save, Prettier replaces single quotes with double quotes, whilst ESLint looks for single quotes.
How can I get the two ...
9
votes
1
answer
3k
views
Preserve then() catch() format when using Prettier JS
I just started using the PrettierJS Plugin for VSCode and I am looking for a way to preserve my code format of my service calls (and subsequent Promises).
I know you can add the //prettier-ignore ...
22
votes
3
answers
15k
views
Prettier doesn't work for changing double quote to single quote in visual code
I work with EsLint and Prettier in visual code. Everything work well without singlequote and doublequote.
This is my .eslintrc file:
{
"parser": "babel-eslint",
"plugins": ["prettier"],
"...
1
vote
0
answers
782
views
Atom Prettier + Eslint
I am using prettier with eslint which works great for everything except method chaining. It breaks it in random times. I don't like how it works and would like to totally disable this feature if ...
2
votes
3
answers
7k
views
Exclude a folder from glob pattern matching
Using Prettier to format js code.
Prettier seems to be using globby under the hood.
I tried the following:
$ prettier './**/*.{js, css}' '!assets/**'
$ prettier './**/*.{js, css}' '!(assets/**)'
$ ...
2
votes
0
answers
199
views
What prettier/eslint rule dictates JSX tag contents on new line
Using prettier with ESLint integration. After a recent upgrade of the prettier package, all my files seem to have gone from
<div>{props.title}</div>
to
<div>
{props.title}
</...
9
votes
6
answers
23k
views
ESLint with Prettier issues on Yarn global install
I'm in the process of setting up my ReactJS environment, and I'm following the FrontendMasters course on the topic.
After having installed eslint and prettier globally via Yarn, the author runs this ...
39
votes
2
answers
19k
views
How to use files with multiple extensions with Prettier?
I have following Prettier commands:
prettier --parser typescript --write ./src/**/*.ts
prettier --parser typescript --write ./src/**/*.tsx
I would like to merge them to single one - use some king of ...
229
votes
2
answers
58k
views
What's the difference between prettier-eslint, eslint-plugin-prettier and eslint-config-prettier?
I want to use Prettier and ESLint together, but I experienced some conflicts just by using them one after another. I see that there are these three packages that seem to allow them to be used in ...
0
votes
1
answer
326
views
yarn - typicode's husky compatibility
I'm using husky for setting git hooks for prettier but I am encountering this error whenever I try to commit or push:
> husky - Can't find npm in PATH. Skipping precommit script in package.json
I'...
1
vote
1
answer
489
views
Eslint Bad Indentation In Array Expressions
I have a simple array definition and i want it to be in the following syntax:
this.selfClosingHtmlTags = [
'area', 'base', 'br', 'col', 'command', 'embed',
'hr', 'img', 'input', 'keygen', 'link',...
2
votes
1
answer
2k
views
prettier js formatter in command line
I would like to run prettier in the terminal command line on my linux machine, but I'm getting an error for some reason. Please advise. Here is my command:
yarn prettier --write test.js
Here is ...
33
votes
8
answers
14k
views
How can I tell prettier to parse files recursively?
I'd like to ask prettier to parse my JavaScript files recursively instead of specifying each folder in which it should check the files.
I'd like to do something like:
prettier --write "...