Last active
October 4, 2020 20:35
-
-
Save Addono/fd0546bbb95820640aafe3437a54d26a to your computer and use it in GitHub Desktop.
Installs yaml-lint as a dependency and creates a pre-commit hook which invokes it using husky.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Add yaml-lint as a dependency | |
yarn add -D yaml-lint | |
# Add a lint script | |
npx json -I -f package.json -e "this.scripts.lint='yamllint *.{yaml,yml}'" | |
# Add husky as a dependency | |
yarn add -D husky | |
# Add yaml lint as a pre-commit hook by husky | |
npx json -I -f package.json -e "this.husky.hooks['pre-commit']='yarn lint'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment