diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03dd7590..e9a2250a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: npx prettier --check . - name: Lint - run: npx eslint src/ + run: npm run lint - name: Typecheck run: npm run typecheck diff --git a/eslint.config.js b/eslint.config.js index 61807201..1ce5fe63 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,17 @@ import eslint from "@eslint/js"; +import globals from "globals"; import tseslint from "typescript-eslint"; -export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, { - ignores: ["dist/", "node_modules/", "test/"], -}); +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + ignores: ["dist/", "node_modules/", "test/"], + }, + { + // Build and maintenance scripts run directly under Node (no TypeScript to + // supply its globals), so `console`, `process`, `fetch` etc. must be declared. + files: ["scripts/**/*.{js,mjs,cjs}"], + languageOptions: { globals: globals.node }, + }, +); diff --git a/package-lock.json b/package-lock.json index 9109b580..a554acc5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/3b2904aed5bbde24af65af1fe73740744df70482", "@eslint/js": "^10.0.1", "eslint": "^10.2.0", + "globals": "^17.14.0", "openclaw": "^2026.7.2-beta.7", "prettier": "^3.8.1", "tsup": "^9.0.0", @@ -7819,6 +7820,19 @@ "node": ">=10.13.0" } }, + "node_modules/globals": { + "version": "17.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.14.0.tgz", + "integrity": "sha512-UtdkTVyAJePQv0J2M9Xe4L0ruNSDV314XiIJsADI2Zf40bcdAonE/D/OhAU8AT99oij9mhLByb+NvA3QWZYgCg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/google-auth-library": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.9.1.tgz", diff --git a/package.json b/package.json index 5cd19eaf..716c3a84 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "test:watch": "vitest", "test:integration": "vitest run --config vitest.integration.config.ts", "typecheck": "tsc --noEmit", - "lint": "eslint src/", + "lint": "eslint src/ scripts/", "format": "prettier --write .", "format:check": "prettier --check .", "test:resilience:errors": "tsx test/resilience-errors.ts", @@ -120,6 +120,7 @@ "@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/3b2904aed5bbde24af65af1fe73740744df70482", "@eslint/js": "^10.0.1", "eslint": "^10.2.0", + "globals": "^17.14.0", "openclaw": "^2026.7.2-beta.7", "prettier": "^3.8.1", "tsup": "^9.0.0",