From dcea9ab42709b776ea5f9cdb3dc3a0aff6fc9f8f Mon Sep 17 00:00:00 2001 From: Joe Hanley Date: Fri, 13 Feb 2026 15:39:38 -0800 Subject: [PATCH] Cache lint results for unchanged files --- .github/workflows/node-test.yml | 8 ++++++++ .gitignore | 1 + package.json | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node-test.yml b/.github/workflows/node-test.yml index 9e3e258232b..7616568c336 100644 --- a/.github/workflows/node-test.yml +++ b/.github/workflows/node-test.yml @@ -163,6 +163,14 @@ jobs: cache: npm cache-dependency-path: npm-shrinkwrap.json + - name: Cache ESLint + uses: actions/cache@v3 + with: + path: .eslintcache + key: eslint-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/*.ts', '**/*.js') }} + restore-keys: | + eslint-${{ runner.os }}-node${{ matrix.node-version }}- + - run: npm i -g npm@9.5 - run: npm ci - run: npm test -- -- --forbid-only diff --git a/.gitignore b/.gitignore index 88fd05c2e9f..d84c7bbac09 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ test_output.log scripts/emulator-tests/functions/index.js yarn.lock .npmrc +.eslintcache .DS_Store .idea diff --git a/package.json b/package.json index 70ed901e04a..f2ccd500f0d 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "lint": "npm run lint:ts && npm run lint:other", "lint:changed-files": "ts-node ./scripts/lint-changed-files.ts", "lint:other": "prettier --check '**/*.{md,yaml,yml}'", - "lint:quiet": "npm run lint:ts -- --quiet && npm run lint:other", - "lint:ts": "eslint --config .eslintrc.js --ext .ts,.js .", + "lint:quiet": "npm run lint:ts -- --cache --quiet && npm run lint:other", + "lint:ts": "eslint --cache --config .eslintrc.js --ext .ts,.js .", "mocha:fast": "mocha 'src/**/*.spec.{ts,js}'", "mocha": "nyc --reporter=html mocha 'src/**/*.spec.{ts,js}'", "prepare": "npm run clean && npm run build:publish",