diff --git a/.eslintrc.json b/.eslintrc.json index 46328ad..3d0b419 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,12 +5,20 @@ "sourceType": "module", "project": "./tsconfig.json" }, + "plugins": ["@typescript-eslint"], "extends": [ ], "rules": { "no-var": "error", "prefer-const": "error", - "no-unused-vars": "error", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], "eqeqeq": "error", "no-eval": "error" } diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..63938cb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: + # Keep GitHub Actions (SHA-pinned in .github/workflows) up to date. + # Dependabot bumps the pinned commit SHA and updates the `# vX.Y.Z` comment. + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" + labels: + - "dependencies" + - "github-actions" + # Collapse all action bumps into a single PR to reduce noise. + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 0000000..6df18ec --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,61 @@ +name: CI + +on: + pull_request: + branches: [main] + +# Least privilege: CI only reads the repository contents. +permissions: + contents: read + +# Cancel superseded runs when a PR is updated, to save CI minutes. +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # Required status check for merging into main (org-wide branch protection + # matches on the job name "check"). + check: + name: check + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 20.19.0 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + lint: + name: lint + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 + with: + node-version: 20.19.0 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint diff --git a/package-lock.json b/package-lock.json index e7a7c27..c97390c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.13", "dependencies": { "@devicefarmer/adbkit-apkreader": "^3.2.4", - "adm-zip": "^0.5.16", + "adm-zip": "^0.6.0", "backslash": "^0.2.0", "bplist-parser": "^0.3.2", "chalk": "^4.1.2", @@ -1288,12 +1288,11 @@ } }, "node_modules/adm-zip": { - "version": "0.5.16", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", - "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==", - "license": "MIT", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.6.0.tgz", + "integrity": "sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==", "engines": { - "node": ">=12.0" + "node": ">=14.0" } }, "node_modules/ajv": { diff --git a/package.json b/package.json index 19cd23b..1c4be98 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ ], "dependencies": { "@devicefarmer/adbkit-apkreader": "^3.2.4", - "adm-zip": "^0.5.16", + "adm-zip": "^0.6.0", "backslash": "^0.2.0", "bplist-parser": "^0.3.2", "chalk": "^4.1.2", diff --git a/script/commands/debug.ts b/script/commands/debug.ts index 0bcc8a1..787bf07 100644 --- a/script/commands/debug.ts +++ b/script/commands/debug.ts @@ -48,7 +48,7 @@ class AndroidDebugPlatform implements IDebugPlatform { private getNumberOfAvailableDevices(): number { const output = childProcess.execSync("adb devices").toString(); const matches = output.match(/\b(device)\b/gim); - if (matches != null) { + if (matches !== null) { return matches.length; } return 0;