Prettier is configured in the editor

🈶️ ESLint is configured in the project

The two conflict

Why don’t vscode automatically add a comma at the end

Solution: Add the following line to setting.json

// # do not place a comma after the last element of an object or array

"prettier.trailingComma": "none",
Copy the code

My complete configuration is:

{ “editor.fontSize”: 16, “editor.accessibilityPageSize”: 16, “workbench.colorTheme”: “One Dark Pro”, “ProjectTree.useDefaultIgnore”: false, “dart.flutterSdkPath”: “/Users/sinochem/development/flutter”, “editor.minimap.enabled”: false,

"editor.wordWrap": "on", "update.enableWindowsBackgroundUpdates": false, "update.mode": "none", "update.showReleaseNotes": false, "window.zoomLevel": 0, "typescript.updateImportsOnFileMove.enabled": "Always ", "explorer.confirmDelete": false, // # format automatically every time save when set to true; When set to false, press Shift + Alt +F "editor.formatOnSave": true, // set TAB indent to 2 "editor.tabSize": "Editor. codeActionsOnSave": {" source.fixall.eslint ": {" source.fixall.eslint ": {" source.fixall.eslint ": true, "eslint.autoFixOnSave": false, "source.fixAll.tslint": true }, "eslint.run": "OnSave ", // # let Prettier use ESLint code for validation // vsCode updates to use editor.codeActionsOnsave // # add a semicolon to the end of code "prettier. Semi ": SingleQuote ": true, "prettier. TabWidth ": 4, // # add "prettier. TrailingComma "after the last element of an object or array: "None", / / # function (name) and add a space between the brackets behind the "javascript. The format. InsertSpaceBeforeFunctionParenthesis" : True, "vetur. Format. DefaultFormatterOptions" : {" js - beautify - HTML ": {/ / # vue component HTML code formatting style" wrap_attributes ": "Force-aligned ", // can also be set to" auto "for different effects. "wrap_line_length": 200, "end_WITH_newline ": false, "semi": false, "singleQuote": true }, "prettier": { "semi": false, "singleQuote": true, "no-tabs": "off" } }, "[jsonc]": { "editor.defaultFormatter": "Esbenp. Prettier - vscode"}, / / formatting stylus, Manta installation 's stylus Supremacy plug-in "stylusSupremacy. InsertColons" : If false, / / insert a colon "stylusSupremacy. InsertSemicolons" : false, / / is inserted into the semicolon "stylusSupremacy. InsertBraces" : If false, / / insert braces "stylusSupremacy. InsertNewLineAroundImports" : False, whether a newline after / / import "stylusSupremacy. InsertNewLineAroundBlocks" : false, "prettier. UseTabs" : true, "files. AutoSave" : "off", "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "diffEditor.ignoreTrimWhitespace": false, "[html]": { "editor.defaultFormatter": "Esbenp. prettier-vscode"}, // Newline in the two selectors // Set the HTML association "emmet.syntaxProfiles" in the vue file: {"vue-html":" HTML ", "vue": "html" }, "explorer.confirmDragAndDrop": false, "terminal.integrated.rendererType": "dom", "files.associations": { "*.ejs": "html", "*.vue": "html" }, "emmet.triggerExpansionOnTab": true, "emmet.includeLanguages": { "vue-html": "html", "vue": "html" }, "editor.accessibilitySupport": "on", "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "editor.tokenColorCustomizations": null, "vetur.format.defaultFormatter.js": "vscode-typescript", "editor.fontLigatures": nullCopy the code

}