1.4.2 • Published 3 years ago
@posop/prettier-config v1.4.2
@posop/prettier-config
My personal Prettier configurations.
Install
npm install @posop/prettier-config -Dyarn add @posop/prettier-config -Dpnpm add @posop/prettier-config -DUsage
Overwrite some properties from the shared configuration
// .prettierrc.js
module.exports = {
...require('@posop/prettier-config'),
}Copy the ignore file to your project folder
If you want to extend the ignore file, run the following command in the root of your project folder:
# unix
cp node_modules/@posop/prettier-config/.prettierignore .prettierignore
# windows
copy node_modules/@posop/prettier-config/.prettierignore .prettierignoreIt will copy the .prettierignore from @posop/prettier-config to your project root folder.
Scripts
Some commonly used scripts in package.json.
{
"scripts": {
"format": "prettier --write --ignore-unknown **",
}
}Rules
Rules used
"tabWidth": 2,
"printWidth": 100,
"semi": false,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": true,
"bracketSameLine": false,
"singleAttributePerLine": true,
"arrowParens": "always",
"trailingComma": "none",
"quoteProps": "as-needed",
"endOfLine": "lf",Related
- Prettier - an opinionated code formatter.
- Prettier - Sharing configurations - Document on sharing prettier configurations.
- Prettier - Ignore Code - Use
.prettierignoreto ignore certain files and folders completely.