Pourquoi est-ce que je continue à recevoir « Supprimer « CR » ?
P粉850680329
P粉850680329 2023-10-11 13:35:23
0
1
434

J'utilise VS Code avec Prettier 1.7.2 et ESLint 1.7.0. Après chaque nouvelle ligne, j'obtiens :

[eslint] Delete `CR` [prettier/prettier]

C'est.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 } }

.prettierrcFichier :

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

Comment éliminer cette erreur ?

P粉850680329
P粉850680329

répondre à tous (1)
P粉787934476

Essayez de définirdans le fichier"endOfLine":"auto".prettierrc

(ou .prettierrc.json) (à l'intérieur de l'objet)

ou paramètres

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

À l'intérieur de l'objetdu fichiereslintrcrules.

Si vous utilisez une machine Windows,endOfLinepeut être "crlf" en fonction de votre configuration git.

    Derniers téléchargements
    Plus>
    effets Web
    Code source du site Web
    Matériel du site Web
    Modèle frontal
    À propos de nous Clause de non-responsabilité Sitemap
    Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!