1.0.2 • Published 1 year ago

@frostbitecms/prettier v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Frostbite prettier rules

Install with npm

npm i -D @frostbitecms/prettier

with yarn

yarn add -D @frostbitecms/prettier

use in package.json

{
  "prettier": "@frostbitecms/prettier"
}

will add the rules for the formatter

Rationale

rulevaluereason
arrowParensalwaysthis is for consistency, i dont really like one liners usually and will just prefer function() anyway, but in react this rule makes it easier to read
bracketSameLinetruei think it looks really weird when the > character is on its own line
bracketSpacingtrueimproves readability of object properties
embeddedLanguageFormattingautoits usually alright about getting this right but it isn't really a big deal to begin with
endOfLinelfthis is for git consistency with diffs since ultimately windows is not a production environment or a "git environment"
jsxSingleQuote, singleQuotetruei like to make the lines less wide so that more can fit on the screen without a horizontal scroll in a multi-window environment
printWidth9080 is a bit low, 100 is too wide for multi-window workspaces but 90 is a nice middle ground
semitrueending a statement explicitly when you can is just better
trailingCommanonejust looks more neat when it doesn't "trail off"
useTabstrueconsistency for people's custom tab width preferences (i prefer 2 personally for the same reasons as quotes)
quotePropsas-neededideally we dont need to quote object keys in sourcecode but if we need to we need to