0.1.2 ā€¢ Published 4 years ago

gformat-html-git-patch v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

gformat-html-git-patch

Runs gFormatHtml on your changed (based on Git) files.

Example:

gformat-html-git-patch
šŸ”  Finding changed files since git revision 2eb4337.
šŸŽÆ  Found 1 changed file.
    ā˜  printWidth: 80, tabWidth: 2
āœļø  Fixing up test.html.
āœ…  Everything is awesome!

Install

npm install --save-dev gformat-html-git-patch

Usage

With npx: (No install required)

npx gformat-html-git-patch

Pre-Commit Hook

You can run gformat-html-git-patch as a pre-commit hook using husky.

yarn add --dev husky

In package.json's "scripts" section, add:

"precommit": "gformat-html-git-patch"

CLI Flags

-s --staged

Only staged files will be formatted, and they will be re-staged after formatting.

Formatter options

We use prettier resolveConfig to indentify your tabWidth and printWidth. It will fallback to .editorconfig.