Ver código fonte

add lint script & workflow

Sv443 3 anos atrás
pai
commit
85c5f75bcd
2 arquivos alterados com 35 adições e 0 exclusões
  1. 34 0
      .github/workflows/lint.yml
  2. 1 0
      package.json

+ 34 - 0
.github/workflows/lint.yml

@@ -0,0 +1,34 @@
+name: "Lint"
+
+on:
+  pull_request:
+    # The branches below must be a subset of the branches above
+    branches: [ main, develop ] # runs on every push
+
+
+jobs:
+  lint:
+    name: Lint
+    runs-on: ubuntu-latest
+
+    timeout-minutes: 10
+
+    strategy:
+      fail-fast: false
+      matrix:
+        node-version: [14.x]
+
+    steps:
+    - uses: actions/checkout@v1 # checkout latest commit
+    - name: Use Node.js ${{ matrix.node-version }} # set up Node.js
+      uses: actions/setup-node@v1
+      with:
+        node-version: ${{ matrix.node-version }}
+    - name: Clean install of dependencies # runs the npm ci command to install all dependencies
+      run: npm ci
+      env:
+        CI: "true"
+    - name: Lint # runs ESLint
+      run: npm run lint
+      env:
+        CI: "true"

+ 1 - 0
package.json

@@ -5,6 +5,7 @@
   "main": "BetterYTM.user.js",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1",
+    "lint": "eslint .",
     "minify": "minify BetterYTM.user.js > BetterYTM.min.user.js"
   },
   "repository": {