Prettier formatter for Visual Studio CodeVS Code package to format your Javascript / Typescript / CSS using Prettier. InstallationInstall through VS Code extensions. Search for Visual Studio Code Market Place: Prettier - JavaScript formatter Can also be installed using
UsageUsing Command Palette (CMD + Shift + P)
Format On SaveRespects Settingsprettier.eslintIntegration (default: false) - Javascript onlyUse prettier-eslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from eslint rules. prettier.printWidth (default: 80)Fit code within this line limit prettier.tabWidth (default: 2)Number of spaces it should use per tab prettier.singleQuote (default: false)If true, will use single instead of double quotes prettier.trailingComma (default: 'none')Controls the printing of trailing commas wherever possible. Valid options:
prettier.bracketSpacing (default: true)Controls the printing of spaces inside object literals prettier.jsxBracketSameLine (default: false)If true, puts the prettier.parser (default: 'babylon') - Javascript onlyWhich parser to use. Valid options are 'flow' and 'babylon'. prettier.semi (default: true)Whether to add a semicolon at the end of every line (semi: true), or only at the beginning of lines that may introduce ASI failures (semi: false) prettier.useTabs (default: false)If true, indent lines with tabs prettier.javascriptEnable (default: ["javascript", "javascriptreact"])Advanced feature. Use this to opt in / out prettier on various language ids. Restart required.
Use parser prettier.typescriptEnable (default: ["typescript", "typescriptreact"])Advanced feature. Use this to opt in / out prettier on various language ids. Restart required.
Use parser prettier.cssEnable (default: ["css", "less", "scss"])Advanced feature. Use this to opt in / out prettier on various language ids. Restart required.
Use parser prettier.jsonEnable (default: ["json"])Advanced feature. Use this to opt in / out prettier on various language ids. Restart required.
Use parser prettier.graphqlEnable (default: ["graphql"])Advanced feature. Use this to opt in / out prettier on various language ids. Restart required.
Use parser Prettier resolutionThis extension will use prettier from your project's local dependencies. Should prettier not be installed locally with your project's dependencies, a copy will be bundled with the extension. ContributeThis is my first Visual Studio Extension so I probably made some terrible choices. Feel free to open issue or PRs! |