Do thing what heroes didn't do.
A code refactoring tool, fixing what eslint/stylelint
shouldn't care about, what prettier
didn't care about. Offering better code comparing for git diff
.
- Enforce consistent brace style
- Handle
tsx/jsx/vue
self closing - Handle text case from
css/scss/less
- Remove vendor prefix from
css/scss/less
- Handle whitespace, empty line between code
- Sort
html/htm
attributes - Sort
jsx/tsx
props - Sort
tsx/ts/mts/cts/jsx/js/mjs/cjs
class members Sorttsx/ts/mts/cts/jsx/js/mjs/cjs
import / export- Sort
vue
component properties / attributes - Dedupe yarn v1 lockfile
- Remove cnpm cache from yarn v1 lockfile
- Sort
OpenAPI Specification
config files (json/yaml/yml
) - ...other fixing
npm install garou --save-dev
npm exec garou .
npm exec garou src
npm exec garou **/foo.js
npx garou .
// example: package.json
{
"garou": {
"import-groups": [
// see: https://github.com/lydell/eslint-plugin-simple-import-sort#custom-grouping
["react", "react-dom"],
// shorthand for ["^@external\\/"]
"^@external\\/",
"lodash"
],
"ignore": ["fixture/**"]
}
}
// package.json
{
"lint-staged": {
"*": ["garou", "prettier", "eslint --fix"]
}
}
Using garou
might mess up your format, I suggest run garou
before run prettier
.
Read more at the lint-staged repo.
Garou will sort your file when it has openapi
properties as 3.x.x
.
npm exec garou "**/*.{json,yaml,yml}"
This project is inspired by sortier.