Why do I keep getting "Remove `CR`"?
P粉850680329
P粉850680329 2023-10-11 13:35:23
0
1
470

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粉850680329
P粉850680329

reply all(1)
P粉787934476

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!