Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I keep getting Delete 'cr' [prettier/prettier]?

I am using vscode with Prettier 1.7.2 and Eslint 1.7.0. After every newline I get:

[eslint] Delete 'cr' [prettier/prettier] 

This is the .eslintrc.json:

{   "extends": ["airbnb", "plugin:prettier/recommended"],   "env": {     "jest": true,     "browser": true   },   "rules": {     "import/no-extraneous-dependencies": "off",     "import/prefer-default-export": "off",     "no-confusing-arrow": "off",     "linebreak-style": "off",     "arrow-parens": ["error", "as-needed"],     "comma-dangle": [       "error",       {         "arrays": "always-multiline",         "objects": "always-multiline",         "imports": "always-multiline",         "exports": "always-multiline",         "functions": "ignore"       }     ],     "no-plusplus": "off"   },   "parser": "babel-eslint",   "plugins": ["react"],   "globals": {     "browser": true,     "$": true,     "before": true,     "document": true   } }  

The .prettierrc file:

{   "printWidth": 80,   "tabWidth": 2,   "semi": true,   "singleQuote": true,   "trailingComma": "es5",   "bracketSpacing": true,   "jsxBracketSameLine": false, } 

How can I get rid of this error?

like image 229
bier hier Avatar asked Nov 28 '18 09:11

bier hier


People also ask

How do I disable eslint prettier?

eslint disable Delete 'cr' [prettier/prettier]? remove eslint-disable-next-line to ignore the next line. eslint-disable-next-line to ignore the next line.

How do I disable eslint prettier VSCode?

prettier-vscode", If you want to disable Prettier for a specific language, you can set the editor. defaultFormatter to null .

What is eslint plugin prettier?

Runs Prettier as an ESLint rule and reports differences as individual ESLint issues. If your desired formatting does not match Prettier's output, you should use a different tool such as prettier-eslint instead. Please read Integrating with linters before installing.


1 Answers

Try setting the "endOfLine":"auto" in your .prettierrc (or .prettierrc.json) file (inside the object)

Or set

'prettier/prettier': [   'error',   {     'endOfLine': 'auto',   } ] 

inside the rules object of the eslintrc file.

If you are using windows machine endOfLine can be "crlf" basing on your git config.

like image 141
Vah Run Avatar answered Sep 21 '22 08:09

Vah Run