Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>PrettierConfig for VS CodeNew to Visual Studio Code? Get it now.
PrettierConfig for VS Code

PrettierConfig for VS Code

whosydd

|
23,874 installs
| (0) | Free
Generate .prettierrc & .prettierignore in the workspace
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PrettierConfig for VS Code

Dependencies

  • prettier

Extension Dependencies

  • Prettier - Code formatter

Usage

prettier 72

Configuration

package manager

// settings.json:
"prettier-config.tool": "npm" // support 'npm' 'yarn' 'pnpm' 'manually'

manually: choose package manager tool when install prettier every time.

Sync from gist

// settings.json:
"prettier-config.gist": {
    // Use raw URL
    "configRaw": "https://gist.githubusercontent.com/whosydd/3d7554d6818b0f9c9a2ec8e928857211/raw/354d4100aa23e8d9379e07d74ad6e4151f482c22/.prettierrc",
    // If you want to generate a .prettierignore file
    // "ignoreRaw": ""
},

tip

// settings.json:
"prettier-config.tip": true //default

Capture

default

.prettierrc

printWidth: 100 # 代码宽度建议不超过100字符
tabWidth: 2 # tab缩进2个空格
semi: false # 末尾分号
singleQuote: true # 单引号
jsxSingleQuote: true # jsx中使用单引号
trailingComma: 'es5' # 尾随逗号
arrowParens: 'avoid' # 箭头函数仅在必要时使用()
htmlWhitespaceSensitivity: 'css' # html空格敏感度

.prettierignore

**/*.min.js
**/*.min.css

.idea/
node_modules/
dist/
build/

Thanks

Alphabet icons created by Freepik - Flaticon

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft