Add ES 5 syntax check (#4291)
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 15 Jun 2021 07:48:19 +0000 (09:48 +0200)
committerGitHub <noreply@github.com>
Tue, 15 Jun 2021 07:48:19 +0000 (09:48 +0200)
.github/workflows/javascript.yml

index 985b9127abbc30a610a178a813bb8311f5c41c1d..dac9327b46da8efc33ba06c437c26bc96b5ebecf 100644 (file)
@@ -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'