prettier#

prettier bietet automatische Formatierer für andere Dateitypen, u.a. für TypeScript, JSON, Vue, YAML, TOML und XML an.

Installation#

$ npm install prettier --save-dev --save-exact

Konfiguration#

$ npx prettier --write path/to/my/file.js

Pre-commit-Hook für prettier#

Installation#

$ npm install pretty-quick husky --save-dev

Konfiguration#

In der package.json-Datei kann der Pre-commit-Hook folgendermaßen konfiguriert werden:

{ "husky": { "hooks": { "pre-commit": "pretty-quick --staged" } } }

Siehe auch