Simplify linting GitHub Action

This commit is contained in:
Matt Triff 2021-12-19 18:09:41 -05:00
parent 9835eb756a
commit c26596e9ec

View file

@ -20,17 +20,13 @@ jobs:
node-version: 12 node-version: 12
- name: Install dependencies - name: Install dependencies
run: npm install --no-optional --no-audit --ignore-scripts run: npm ci
env: env:
CYPRESS_INSTALL_BINARY: 0 CYPRESS_INSTALL_BINARY: 0
HUSKY_SKIP_INSTALL: true HUSKY_SKIP_INSTALL: true
- name: run eslint - name: run eslint
run: | run: npm run lint:js
CHANGED_TS=$(git --no-pager diff --name-only ..origin/master | grep '^src\/scripts\/.*\.ts$' | xargs ls -d 2>/dev/null | paste -sd " " -)
if [[ -z $(sed -e 's/[[:space:]]*$//' <<<${CHANGED_TS}) ]]; then CHANGED_TS="src/scripts"; fi
echo $CHANGED_TS
node node_modules/eslint/bin/eslint.js $CHANGED_TS
## Can't use same eslint config for TypeScript and JavaScript ## Can't use same eslint config for TypeScript and JavaScript
## TypeScript rules cause rule definition not found errors ## TypeScript rules cause rule definition not found errors