From e38a34384a2933f2b3dab3f176c88f3e8d39d11f Mon Sep 17 00:00:00 2001 From: dkanada Date: Sat, 16 Mar 2019 01:55:47 -0700 Subject: [PATCH] add ci for eslint --- .drone.yml | 9 +++++++++ .eslintrc.yml | 3 +++ run-eslint.sh | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .drone.yml create mode 100644 .eslintrc.yml create mode 100644 run-eslint.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000..d1a67db6e8 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,9 @@ +--- +kind: pipeline +name: eslint + +steps: +- name: run + image: nextcloudci/eslint:eslint-1 + commands: + - ./run-eslint.sh diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000000..943b958ecd --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,3 @@ +env: + browser: true + amd: true diff --git a/run-eslint.sh b/run-eslint.sh new file mode 100644 index 0000000000..46b74c1a7e --- /dev/null +++ b/run-eslint.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +# used this pull request for reference +# https://github.com/nextcloud/spreed/pull/48 +ESLINT=$(which eslint || true) +if [ -z "$ESLINT" ] +then + echo "could not find eslint in $PATH" + exit 1 +fi + +echo checking scripts with $ESLINT +find -name "*.js" -print0 | xargs -0 $ESLINT + +# use this line to test changes locally +#find src -name "*.js" -exec sh -c 'npx eslint $1' -- {} \;