Skip to content

Commit 986de42

Browse files
author
Colin McNeil
committed
Suppress eslint output
1 parent 2625901 commit 986de42

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

prompts/eslint/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ docker build . -t vonwig/standardjs:local -f standardjs.Dockerfile
8585
Push
8686

8787
```sh
88-
docker build --push . -t vonwig/eslint:latest
89-
docker build --push . -t vonwig/extractor-eslint:latest -f extractor.Dockerfile
90-
docker build --push . -t vonwig/standardjs:latest -f standardjs.Dockerfile
88+
docker build --push . -t vonwig/eslint:latest --push
89+
docker build --push . -t vonwig/extractor-eslint:latest -f extractor.Dockerfile --push
90+
docker build --push . -t vonwig/standardjs:latest -f standardjs.Dockerfile --push
9191
```

prompts/eslint/scripts/lint.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
PROJECT_DIR="/project"
44

5-
echo "ARGS:"
6-
75
# First arg
86
ARGS="$1"
97

@@ -13,4 +11,16 @@ ESLINT_ARGS=$(echo $ARGS | jq -r '.args')
1311

1412
ESLINT_VERSION=$(echo $ARGS | jq -r '.version')
1513

16-
npx --no-install "eslint@$ESLINT_VERSION" $ESLINT_ARGS
14+
echo "Linting: eslint@$ESLINT_VERSION $ESLINT_ARGS"
15+
16+
# Run eslint but suppress the output
17+
npx --no-install "eslint@$ESLINT_VERSION" $ESLINT_ARGS > /dev/null
18+
19+
# If eslint fails, exit with the exit code
20+
if [ $? -ne 0 ]; then
21+
echo "ESLint exited with an error code: $?"
22+
exit $?
23+
else
24+
echo "ESLint passed with no errors"
25+
exit 0
26+
fi

0 commit comments

Comments
 (0)