-
-
Save danielmcq/fef2e62bb43b8bcac87da673676933a8 to your computer and use it in GitHub Desktop.
Do eslint only changed files
This file contains hidden or 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
# The regexp without escapse is ^[^D]{2}.*((.js)|/)$ with: | |
# [^D]{2} means that's not a deleted file from git output | |
# .* is the file name | |
# ((.js)|/) means it's end with .js extension, or a slash (directory) | |
# To use in package.json, we need to double the escapse: ^[^D]\\{2\\}.*\\(\\(\\.js\\)\\|/\\)$ pretty neat huh? | |
git status --porcelain | grep '^[^D]\{2\}.*\(\(\.js\)\|/\)$' | cut -c 4- | xargs eslint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment