File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99set -euo pipefail
1010
11+ # parse args
12+ USE_CACHE=true
13+ for ARG in " $@ " ; do
14+ if [[ " $ARG " == " --no-cache" ]]; then
15+ USE_CACHE=false
16+ break
17+ fi
18+ done
19+
20+ # Preserve default behavior of linting the whole repo when no target is passed.
21+ if [[ " $# " -eq 0 ]]; then
22+ set -- .
23+ fi
24+
25+ # Build ESLint args
26+ ESLINT_ARGS=()
27+ if [[ " $USE_CACHE " == " true" ]]; then
28+ ESLINT_ARGS+=(
29+ --cache
30+ --cache-location=node_modules/.cache/eslint
31+ --cache-strategy content
32+ )
33+ fi
34+ ESLINT_ARGS+=(
35+ --concurrency=auto
36+ --no-warn-ignored
37+ " $@ "
38+ )
39+
40+ # Run ESLint with the repo's default memory ceiling and seatbelt behavior.
1141NODE_OPTIONS=" ${NODE_OPTIONS:- --max_old_space_size=8192} " \
1242SEATBELT_FROZEN=" ${SEATBELT_FROZEN:- 0} " \
13- exec npx eslint \
14- --cache \
15- --cache-location=node_modules/.cache/eslint \
16- --cache-strategy content \
17- --concurrency=auto \
18- --no-warn-ignored \
19- " ${@:- .} "
43+ exec npx eslint " ${ESLINT_ARGS[@]} "
You can’t perform that action at this time.
0 commit comments