Skip to content

Commit 4c1d90f

Browse files
committed
Fix lint no-cache handling
Made-with: Cursor
1 parent f8263d4 commit 4c1d90f

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

scripts/lint.sh

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,32 @@
88

99
set -euo pipefail
1010

11+
use_cache=true
12+
for arg in "$@"; do
13+
if [[ "$arg" == "--no-cache" ]]; then
14+
use_cache=false
15+
break
16+
fi
17+
done
18+
19+
if [[ "$#" -eq 0 ]]; then
20+
set -- .
21+
fi
22+
23+
eslint_args=()
24+
if [[ "$use_cache" == "true" ]]; then
25+
eslint_args+=(
26+
--cache
27+
--cache-location=node_modules/.cache/eslint
28+
--cache-strategy content
29+
)
30+
fi
31+
eslint_args+=(
32+
--concurrency=auto
33+
--no-warn-ignored
34+
"$@"
35+
)
36+
1137
NODE_OPTIONS="${NODE_OPTIONS:---max_old_space_size=8192}" \
1238
SEATBELT_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-
"${@:-.}"
39+
exec npx eslint "${eslint_args[@]}"

0 commit comments

Comments
 (0)