Skip to content

Instantly share code, notes, and snippets.

@jrgcubano
Created September 28, 2017 15:36
Show Gist options
  • Save jrgcubano/cb53da7c1c0377d17145048486eae6eb to your computer and use it in GitHub Desktop.
Save jrgcubano/cb53da7c1c0377d17145048486eae6eb to your computer and use it in GitHub Desktop.
Prettier vscode settings
{
/* Prettier */
// Fit code within this line limit
"prettier.printWidth": 80,
// Number of spaces it should use per tab
"prettier.tabWidth": 2,
// If true, will use single instead of double quotes
"prettier.singleQuote": true,
// Controls the printing of trailing commas wherever possible. Valid options:
// "none" - No trailing commas
// "es5" - Trailing commas where valid in ES5 (objects, arrays, etc)
// "all" - Trailing commas wherever possible (function arguments)
"prettier.trailingComma": "es5",
// Controls the printing of spaces inside object literals
"prettier.bracketSpacing": true,
// If true, puts the > of a multi-line jsx element at the end of the last line instead of being alone on the next line
"prettier.jsxBracketSameLine": false,
// Which parser to use. Valid options are 'flow' and 'babylon'.
"prettier.parser": "babylon",
//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.semi": true,
// If true, indent lines with tabs
"prettier.useTabs": false,
/* VsCode Prettier Specifig Settings */
// Use prettier-eslint instead of prettier. Other settings will only be fallbacks in case they could not be inferred from eslint rules
"prettier.eslintIntegration": false,
//Advanced feature. Use this to opt in / out prettier on various language ids. Restart required. Use parser babylon or flow depending on prettier.parser for given language ids. Use with care.
"prettier.javascriptEnable": ["javascript", "javascriptreact"],
// Advanced feature. Use this to opt in / out prettier on various language ids. Restart required. Use parser typescript for given language ids. Use with care.
"prettier.typescriptEnable": ["typescript", "typescriptreact"],
// Advanced feature. Use this to opt in / out prettier on various language ids. Restart required. Use parser postcss for given language ids. Use with care.
"prettier.cssEnable": ["css", "less", "scss"],
// Advanced feature. Use this to opt in / out prettier on various language ids. Restart required. Use parser json for given language ids. Use with care.
"prettier.jsonEnable": ["json"],
// Advanced feature. Use this to opt in / out prettier on various language ids. Restart required. Use parser graphql for given language ids. Use with care.
"prettier.graphqlEnable": ["graphql"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment