0.1.0 • Published 6 years ago
prettierify v0.1.0
prettierify
Adds prettier to your project in one command. Just run npx prettierify in the root of your project.
Optionally create a file ~/.prettierrc in your home directory.
At recogizer, for example, we use the following config:
{
"semi": false,
"singleQuote": true,
"trailingComma": "all"
} The command npx prettierify does several things:
- Runs
npm i -D husky lint-staged prettier - Creates a file .prettierrc. It is a copy of
~/.prettierrcfrom your home directory. - Adds lint-staged block to
package.json.
"lint-staged": {
"*.{js,json,css}": ["prettier --write", "git add"],
"*.ts": [
"tslint --fix -c ./tslint.json 'src/**/*{.ts,.tsx}'",
"prettier --write",
"git add"
]
},- In
package.json, adds a line to scripts:"precommit": "lint-staged" - Finally,
prettierifyappliesprettierto all files in your project.
Steps 1-4 add a pre-commit hook that guarantees all your files will be formatted before commits.
0.1.0
6 years ago
0.1.0-beta.6
7 years ago
0.1.0-beta.5
7 years ago
0.1.0-beta.4
7 years ago
0.1.0-beta.3
7 years ago
0.1.0-beta.2
7 years ago
0.1.0-beta.1
7 years ago
0.1.0-beta.0
7 years ago