Questions tagged «prettier»

11
为什么我不断收到Delete'cr'[prettier / prettier]?
我在Prettier 1.7.2和Eslint 1.7.0中使用vscode。在每个换行符之后,我得到: [eslint] Delete 'cr' [prettier/prettier] 这是.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" …

20
为什么Prettier不格式化VSCODE中的代码?
在安装和启用了ESlint和Prettier的Nuxt应用程序中,我切换到了Visual Studio Code编辑器。 当我打开.vue文件并按CMD+ Shift+P 并选择“格式化文档”时,我的文件根本没有被格式化。 我的 .prettierrc 设置: { "tabWidth": 2, "semi": false, "singleQuote": true } 我有很多源代码行,我无法手动设置它们的格式。我究竟做错了什么?

1
漂亮的eslint,eslint的插件prettier和eslint的配置prettier有什么区别?
我想同时使用Prettier和ESLint,但是仅通过一个接一个地使用它们,我遇到了一些冲突。我看到似乎有这三个软件包可以让它们串联使用: prettier-eslint eslint-plugin-prettier eslint-config-prettier 但是,我不确定要使用哪个包名称,因为它们都包含eslint和prettier。 我应该使用哪个?

6
在VS Code中,我收到此错误,“无法加载模块。试图从package.json加载漂亮的图片
当我使用VS Code并打开一个项目时,我在右下角收到此通知: Failed to load module. If you have prettier or plugins referenced in package.json, ensure you have runnpm安装Attempted to load prettier from package.json. Source: Prettier Code Format (Extension) 运行npm install无法解决此问题。任何人都知道为什么会这样,或者我可以做些什么来解决它?

4
更漂亮的vscode“ r不是函数”
在vscode中使用更漂亮的代码已有一段时间了,但是最近它停止了工作,我不确定这是他们的错误还是我的配置错误。 ["INFO" - 02:54:03] Loaded module 'prettier@1.19.1' from '/Users/paulrberg/.nvm/versions/node/v10.17.0/lib/node_modules/prettier' ["INFO" - 02:54:03] Formatting using 'prettier-eslint' ["ERROR" - 02:54:03] Error formatting document. r is not a function TypeError: r is not a function at /Users/paulrberg/.vscode/extensions/esbenp.prettier-vscode-3.13.0/dist/extension.js:1:352891 at t.default.safeExecution (/Users/paulrberg/.vscode/extensions/esbenp.prettier-vscode-3.13.0/dist/extension.js:1:353582) at t.default.<anonymous> (/Users/paulrberg/.vscode/extensions/esbenp.prettier-vscode-3.13.0/dist/extension.js:1:352865) at Generator.next (<anonymous>) at s (/Users/paulrberg/.vscode/extensions/esbenp.prettier-vscode-3.13.0/dist/extension.js:1:347571)
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.