Speed up linting if eslint_d is available

This commit is contained in:
Ramon Wenger 2024-03-13 14:56:14 +01:00
parent 0fcd6b1913
commit aa9bbba893
2 changed files with 13 additions and 1 deletions

12
client/eslint-checker.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# see if eslint_d is available
args="--ext .js,.vue,.ts src"
if command -v eslint_d &> /dev/null
then
echo "using eslint_d"
eslint_d $args
else
echo "using eslint"
eslint $args
fi

View File

@ -10,7 +10,7 @@
"private": true,
"scripts": {
"start": ". ../server/.env && npm run dev",
"lint": "eslint --ext .js,.vue,.ts src",
"lint": "./eslint-checker.sh",
"fix-lint": "eslint --ext .js,.vue,.ts --fix src",
"build": "vite build",
"dev": "vite",