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- # Disable the wrapper's cache flags when ESLint caching is explicitly disabled.
12- use_cache =true
13- for arg in " $@ " ; do
14- if [[ " $arg " == " --no-cache" ]]; then
15- use_cache =false
11+ # parse args
12+ USE_CACHE =true
13+ for ARG in " $@ " ; do
14+ if [[ " $ARG " == " --no-cache" ]]; then
15+ USE_CACHE =false
1616 break
1717 fi
1818done
1919
20- # Preserve the old default of linting the whole repo when no target is passed.
20+ # Preserve default behavior of linting the whole repo when no target is passed.
2121if [[ " $# " -eq 0 ]]; then
2222 set -- .
2323fi
2424
25- # Build ESLint args so cache flags can be conditionally omitted.
26- eslint_args =()
27- if [[ " $use_cache " == " true" ]]; then
28- eslint_args +=(
25+ # Build ESLint args
26+ ESLINT_ARGS =()
27+ if [[ " $USE_CACHE " == " true" ]]; then
28+ ESLINT_ARGS +=(
2929 --cache
3030 --cache-location=node_modules/.cache/eslint
3131 --cache-strategy content
3232 )
3333fi
34- eslint_args +=(
34+ ESLINT_ARGS +=(
3535 --concurrency=auto
3636 --no-warn-ignored
3737 " $@ "
@@ -40,4 +40,4 @@ eslint_args+=(
4040# Run ESLint with the repo's default memory ceiling and seatbelt behavior.
4141NODE_OPTIONS=" ${NODE_OPTIONS:- --max_old_space_size=8192} " \
4242SEATBELT_FROZEN=" ${SEATBELT_FROZEN:- 0} " \
43- exec npx eslint " ${eslint_args [@]} "
43+ exec npx eslint " ${ESLINT_ARGS [@]} "
You can’t perform that action at this time.
0 commit comments