Skip to content

Commit

Permalink
fix script for linting changed files (#17028)
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-decker authored Jan 20, 2023
1 parent a19a5d6 commit c9bbfa4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions development/get-changed-file-names.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash
# This file exists because yarn 2+ seems to not be able to use the yarn 1
# syntax in "scripts" to concatenate two commands output together using { }.
# This script simply outputs both and then normal pipe operator syntax can be
# used in the "scripts" key can be used to operate on the output.

git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"lint:fix": "yarn lint:prettier:fix && yarn lint:eslint:fix && yarn lint:styles:fix",
"lint:prettier": "prettier --check -- **/*.json",
"lint:prettier:fix": "prettier --write -- **/*.json",
"lint:changed": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' | tr '\\n' '\\0' | xargs -0 eslint",
"lint:changed:fix": "{ git ls-files --others --exclude-standard ; git diff-index --name-only --diff-filter=d HEAD ; } | grep --regexp='[.]js$' | tr '\\n' '\\0' | xargs -0 eslint --fix",
"lint:changed": "./development/get-changed-file-names.sh | grep --regexp='[.]js$' | tr '\\n' '\\0' | xargs -0 eslint",
"lint:changed:fix": "./development/get-changed-file-names.sh | grep --regexp='[.]js$' | tr '\\n' '\\0' | xargs -0 eslint --fix",
"lint:changelog": "auto-changelog validate",
"lint:changelog:rc": "auto-changelog validate --rc",
"lint:eslint": "eslint . --ext js,ts,tsx,snap --cache",
Expand Down

0 comments on commit c9bbfa4

Please sign in to comment.