I'm using VS Code with Prettier 1.7.2 and ESLint 1.7.0. After each newline I get:
[eslint] Delete `CR` [prettier/prettier]
This is .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 } }
.prettierrc
File:
{ "printWidth": 80, "tabWidth": 2, "semi": true, "singleQuote": true, "trailingComma": "es5", "bracketSpacing": true, "jsxBracketSameLine": false, }
How to eliminate this error?
Try setting "endOfLine":"auto"
(or .prettierrc.json) file (inside the object)in the
.prettierrcor setting
Inside the rules object of the
eslintrc
file.If you are using a Windows machine,
endOfLine
can be set to "crlf" based on your git configuration.