From 2d35dbce84fbe97e8dc80629d889b51953e1641e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 15 Jun 2021 09:48:19 +0200 Subject: [PATCH] Add ES 5 syntax check (#4291) --- .github/workflows/javascript.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 985b9127ab..dac9327b46 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -29,3 +29,22 @@ jobs: |awk 'BEGIN {m=0} /(.js):[0-9]+$/ {m=1; printf "%s - ",$0} m==1 && /^SyntaxError/ { m=0; print }' \ |sed "s@$(pwd)@.@" \ |grep '^' + es5: + name: "Check ES5 Syntax" + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: Set up node.js + uses: actions/setup-node@v1 + with: + node-version: "12" + - uses: actions/checkout@v2 + - run: npm i es5-validator debug --save-dev + - name: Remove files to be ignored + run: | + rm wcfsetup/install/files/js/3rdParty/prism/build.js + rm wcfsetup/install/files/js/3rdParty/zxcvbn.js + - run: | + ! find wcfsetup/ -type f -name '*.js' -exec node_modules/.bin/es5-validator '{}' \; 2>&1 \ + |grep 'ECMAScript 5 validate failed' -- 2.20.1