0.1.4 • Published 5 months ago

stylelint-diff-fixer v0.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Stylelint Diff Fixer

CLI tool that applies Stylelint's autofix only to the diff lines in Git.

.css and .scss file formats are supported.

Examples

Before

.a {
    margin: 0px;
+    color: #000000;
+    border: 0px;
+    display: block;
    padding: 0px;
}

After

.a {
    margin: 0px;
+    display: block;
+    color: #000;
+    border: 0;
    padding: 0px;
}

The behavior of the fix depends on the project's Stylelint settings.

Usage

1. Install

npm i -D stylelint-diff-fixer

2. Run

stylelint-diff-fixer <FILE_PATH>
stylelint-diff-fixer style/001.css
# FIX  style/001.css (2 hunks)

stylelint-diff-fixer "style/*.css"
# FIX  style/001.css (2 hunks)
# FIX  style/002.css (1 hunk)

stylelint-diff-fixer
# FIX  style/001.css (2 hunks)
# FIX  style/002.css (1 hunk)
# FIX  style/sub/001.scss (1 hunk)

Option

Arguments:
  filepath    file path to fix (default: "\"*.css\" \"*.scss\"")

Options:
  -h, --help  display help for command

License

MIT

Author

Oteto

0.1.4

5 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago