'Prettier ask me to replace ⏎↹↹ with ·
I have no clue what's going on,
I cloned a github repo and literally just tried to change like one line but I got hit by this prettier error which makes no sense to me (I've never used prettier).
Replace ↹return·(⏎↹↹<img·alt='logo'·src='./Logo.png'·/>⏎↹); with ··return·<img·alt="logo"·src="./Logo.png"·/> prettier/prettier
Anything could be helpful at this point, I'm using MacOS and working on VSCode
Solution 1:[1]
I had the same issue, in the eslinrc.json file under "prettier/prettier", I removed printWidth.
Solution 2:[2]
This is usally due to some configuration with eslint preventing you from making errors and introducing unwanted characters in your code. I fixed this by running one line eslint --fix . . Make sure you install eslint globally first npm i -g eslint .
Solution 3:[3]
I think this is caused by Prettier being configured to use spaces instead of tabs to indent and then your code editor using tabs. So Prettier wants you to replace those tabs with spaces.
Alternatively, you can set your code editor to use tabs.
What worked for me was adding this to the rules object in .prettierrc:
{
"useTabs": false
}
Solution 4:[4]
I had the same issue, I changed the tab width inside the prettier formatter extension to the configured size.
Solution 5:[5]
I added in the .prettierc props "endOfline".
{
"endOfLine": "lf",
}
By default Windows uses CRLF line separator, so you can cahnge it through a global config of IDE to use LF instad of CRLF
Solution 6:[6]
For me I had to remove
"extends": "eslint:recommended",
from the .eslintrc.js file in the project.
Solution 7:[7]
I figured the formatting issue (VS Code):
settings.json:
"editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "editor.defaultFormatter": "dbaeumer.vscode-eslint", "editor.formatOnSave": true
.eslintrc.json:
"useTabs": false}.editorconfig:
indent_style = spaceif esbenp.prettier-vscode is enabled in VSCode - please disable it.
See my complete eslint + prettier setup for this repo: https://github.com/Sgryts/ng2-feature-toggle
Solution 8:[8]
You can just set/update this rule in your .eslintrc.js
rules: {
...,
'prettier/prettier': ['error', { printWidth: 120 }],
}
By default, printWidth is 80. ESLint wants to break down the line to match this length requirement that can be overwitten.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Xavier Maldonado |
| Solution 2 | Tony Marfo O |
| Solution 3 | |
| Solution 4 | tomscoding |
| Solution 5 | Max Sychov |
| Solution 6 | jakobinn |
| Solution 7 | Sgryt |
| Solution 8 | Calhau |
