generated from ddev/ddev-addon-template
-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy patheslint
executable file
·20 lines (18 loc) · 960 Bytes
/
eslint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#ddev-generated
## Command provided by https://github.com/ddev/ddev-drupal-contrib
## Description: Run eslint inside the web container
## Usage: eslint [flags] [args]
## Example: "ddev eslint"
## ExecRaw: true
if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
# Configure prettier
test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json .
test -e .prettierignore || echo '*.yml' > .prettierignore
# Change directory to the project root folder
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --config="../../../core/.eslintrc.passing.json" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@"
else
echo "eslint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
fi