确实安装了Prettier+就可以了
扩展 "Prettier - Code formatter" 无法格式化 "app.js"?工具版本:微信开发者工具 Stable 1.03.2009140 操作系统:macOS Catalina 10.15.6 保存文件自动格式化时提示:扩展 "Prettier - Code formatter" 无法格式化 "app.js" [图片] 编辑器配置: { "editor.formatOnSave": true, "editor.stablePeek": true, "editor.tabCompletion": "on", "editor.tabSize": 4, "editor.wordWrapColumn": 120, "editor.minimap.enabled": true, "explorer.openEditors.visible": 0, "search.exclude": { "**/dist": true, "**/miniprogram_npm": true }, "files.watcherExclude": { "**/dist/**": true, "**/miniprogram_npm/**": true }, "files.associations": { "*.cjson": "jsonc", "*.wxs": "javascript", "*.wxss": "css" }, "[wxml]": { "editor.defaultFormatter": "qiu8310.minapp-vscode" }, "[css]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "minapp-vscode.wxmlFormatter": "prettyHtml", "minapp-vscode.formatMaxLineCharacters": 120, "minapp-vscode.disableAutoConfig": true, "minapp-vscode.showSuggestionOnEnter": true, "minapp-vscode.prettier": { "printWidth": 120, "semi": false, "singleQuote": true, "trailingComma": "none" }, "minapp-vscode.prettyHtml": { "printWidth": 120, "usePrettier": false, "sortAttributes": true }, "prettier.printWidth": 120, "prettier.singleQuote": true, "prettier.semi": false, "prettier.trailingComma": "none", "less.compile": { "outExt": ".wxss" } } 自定义扩展: [图片]
2021-09-24