Skip to content

Instantly share code, notes, and snippets.

@masives
masives / pre-commit
Created May 24, 2018 12:13
precommit hook for eslint and stylelint
#!/bin/bash
## PRECOMMIT LINTING
# list staged files
STAGED_FILES_TS="$(git diff --cached --name-only | grep "\.ts$")"
STAGED_FILES_SCSS="$(git diff --cached --name-only | grep "\.scss$")"
STAGED_FILES_VUE="$(git diff --cached --name-only | grep "\.vue$")"
# Define helper variables
PASS_LINT=true
PASS_STAGING_COMPARATION=true