Skip to content

Commit be1ff0b

Browse files
authored
Merge pull request Expensify#89063 from Expensify/rory/fix-lint-no-cache
[No QA] Enable no-cache linting
2 parents e4af3da + bfdd986 commit be1ff0b

1 file changed

Lines changed: 31 additions & 7 deletions

File tree

scripts/lint.sh

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

99
set -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.
1141
NODE_OPTIONS="${NODE_OPTIONS:---max_old_space_size=8192}" \
1242
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-
"${@:-.}"
43+
exec npx eslint "${ESLINT_ARGS[@]}"

0 commit comments

Comments
 (0)