search

Home  >  Q&A  >  body text

Why do I keep getting "Remove `CR`"?

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?

P粉850680329P粉850680329471 days ago552

reply all(1)I'll reply

  • P粉787934476

    P粉7879344762023-10-12 10:04:13

    Try setting "endOfLine":"auto" in the .prettierrc

    (or .prettierrc.json) file (inside the object)

    or setting

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

    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.

    reply
    0
  • Cancelreply