From e0d0292c84c25279e9b6794d2aeb3e6445491c99 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Fri, 31 Jul 2026 10:19:24 +0200 Subject: [PATCH 1/5] Key ESLint cache on lint deps only and drop stale catch-all fallback --- .github/workflows/lint.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a7a194d19904..90b47918939f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,19 +33,23 @@ jobs: - name: Setup Node uses: ./.github/actions/composite/setupNode - - name: Remove E/App version from package-lock.json + # Extract only the lint-affecting dependencies (eslint packages, plus + # typescript/ts-api-utils since a TS bump can change type-aware lint results). + # The cache key hashes this slice so a cold full re-lint happens only when + # the lint config or a lint dependency changes -- not on every dep bump. + - name: Extract lint-related deps from package-lock.json shell: bash - run: jq 'del(.version, .packages[""].version)' package-lock.json > normalized-package-lock.json + run: | + jq '{packages: (.packages | to_entries | map(select(.key | test("eslint|^node_modules/(typescript|ts-api-utils)$"))) | from_entries)}' package-lock.json > lint-deps-lock.json - name: Restore ESLint cache # v5.0.1 uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb with: path: node_modules/.cache/eslint - key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'normalized-package-lock.json') }}-${{ github.sha }} + key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'lint-deps-lock.json') }}-${{ github.sha }} restore-keys: | - ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'normalized-package-lock.json') }}- - ${{ runner.os }}-eslint- + ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'lint-deps-lock.json') }}- # ESLint's cache doesn't track cross-file TypeScript dependencies, which can cause stale errors. # If lint fails, we clear the cache and retry to rule out false positives. @@ -69,7 +73,7 @@ jobs: if: always() with: path: node_modules/.cache/eslint - key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'normalized-package-lock.json') }}-${{ github.sha }} + key: ${{ runner.os }}-eslint-${{ hashFiles('eslint.config.mjs', 'config/eslint/**', 'lint-deps-lock.json') }}-${{ github.sha }} # If lint tightened the seatbelt baseline (i.e. fewer baselined errors than last time), # commit the updated TSV back to `main` as OSBotify. Only runs under `workflow_call` From 29bb524218f9a7553ca58058163cc7ab93eb5ed8 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Fri, 31 Jul 2026 10:39:40 +0200 Subject: [PATCH 2/5] Try downgrade eslint-config-expensify --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 74f358bce421..8dd0fa51ec04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -236,7 +236,7 @@ "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", "eslint": "^9.36.0", - "eslint-config-expensify": "4.0.8", + "eslint-config-expensify": "4.0.7", "eslint-config-prettier": "^9.1.0", "eslint-plugin-file-progress": "3.0.1", "eslint-plugin-jest": "^29.0.1", @@ -24083,9 +24083,9 @@ } }, "node_modules/eslint-config-expensify": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/eslint-config-expensify/-/eslint-config-expensify-4.0.8.tgz", - "integrity": "sha512-+ynj6rw5GSU41JVHzwwMoV7TnxjZQt4REJykwdg7ZwCDd7okSn15WxxfJSZAvP2FzqB0hLqbY9FS9G43TokPIQ==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eslint-config-expensify/-/eslint-config-expensify-4.0.7.tgz", + "integrity": "sha512-T/bNoPQRzPakHzYUj08ganDl3U3Qx1PWjovt1Ot9zvPz1m+bWYD9AoTdnOdBB+0oNu4A+iODCkq0jO82bRJITg==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 8bb74c788bda..fd18f02d39d6 100644 --- a/package.json +++ b/package.json @@ -310,7 +310,7 @@ "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", "eslint": "^9.36.0", - "eslint-config-expensify": "4.0.8", + "eslint-config-expensify": "4.0.7", "eslint-config-prettier": "^9.1.0", "eslint-plugin-file-progress": "3.0.1", "eslint-plugin-jest": "^29.0.1", From 84ee947d7620d5edbd74e5aa24e128ea26fd3ce6 Mon Sep 17 00:00:00 2001 From: VickyStash Date: Fri, 31 Jul 2026 11:05:19 +0200 Subject: [PATCH 3/5] Revert "Try downgrade eslint-config-expensify" This reverts commit 29bb524218f9a7553ca58058163cc7ab93eb5ed8. --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8dd0fa51ec04..74f358bce421 100644 --- a/package-lock.json +++ b/package-lock.json @@ -236,7 +236,7 @@ "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", "eslint": "^9.36.0", - "eslint-config-expensify": "4.0.7", + "eslint-config-expensify": "4.0.8", "eslint-config-prettier": "^9.1.0", "eslint-plugin-file-progress": "3.0.1", "eslint-plugin-jest": "^29.0.1", @@ -24083,9 +24083,9 @@ } }, "node_modules/eslint-config-expensify": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eslint-config-expensify/-/eslint-config-expensify-4.0.7.tgz", - "integrity": "sha512-T/bNoPQRzPakHzYUj08ganDl3U3Qx1PWjovt1Ot9zvPz1m+bWYD9AoTdnOdBB+0oNu4A+iODCkq0jO82bRJITg==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/eslint-config-expensify/-/eslint-config-expensify-4.0.8.tgz", + "integrity": "sha512-+ynj6rw5GSU41JVHzwwMoV7TnxjZQt4REJykwdg7ZwCDd7okSn15WxxfJSZAvP2FzqB0hLqbY9FS9G43TokPIQ==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index fd18f02d39d6..8bb74c788bda 100644 --- a/package.json +++ b/package.json @@ -310,7 +310,7 @@ "diff-so-fancy": "^1.3.0", "dotenv": "^16.0.3", "eslint": "^9.36.0", - "eslint-config-expensify": "4.0.7", + "eslint-config-expensify": "4.0.8", "eslint-config-prettier": "^9.1.0", "eslint-plugin-file-progress": "3.0.1", "eslint-plugin-jest": "^29.0.1", From b97e3d641839d29ccbeb7fd4a4a9720b6cee7d5b Mon Sep 17 00:00:00 2001 From: VickyStash Date: Fri, 31 Jul 2026 12:34:59 +0200 Subject: [PATCH 4/5] Clear sticky-disk ESLint cache before restore so cache key is the only source --- .github/workflows/lint.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90b47918939f..3f0b957b6ea9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -42,6 +42,14 @@ jobs: run: | jq '{packages: (.packages | to_entries | map(select(.key | test("eslint|^node_modules/(typescript|ts-api-utils)$"))) | from_entries)}' package-lock.json > lint-deps-lock.json + # The setupNode sticky disk persists all of node_modules between runs, including + # node_modules/.cache/eslint. Clear it so the restore step below is the only cache + # source -- a restore miss doesn't delete pre-existing files, so without this a + # config change would silently reuse the stale cache carried over by the disk. + - name: Clear ESLint cache carried over by the node_modules sticky disk + shell: bash + run: rm -rf node_modules/.cache/eslint + - name: Restore ESLint cache # v5.0.1 uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb From cdb7ce48799d64224909b6581892411b945460f4 Mon Sep 17 00:00:00 2001 From: Tomasz Misiukiewicz Date: Mon, 3 Aug 2026 08:49:38 +0200 Subject: [PATCH 5/5] Include parser chain deps in ESLint cache key --- .github/workflows/lint.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3f0b957b6ea9..0627965accd5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,14 +33,15 @@ jobs: - name: Setup Node uses: ./.github/actions/composite/setupNode - # Extract only the lint-affecting dependencies (eslint packages, plus - # typescript/ts-api-utils since a TS bump can change type-aware lint results). + # Extract only the lint-affecting dependencies: eslint packages, the parser chain + # (espree/acorn) whose bumps can silently change parse results, plus + # typescript/ts-api-utils since a TS bump can change type-aware lint results. # The cache key hashes this slice so a cold full re-lint happens only when # the lint config or a lint dependency changes -- not on every dep bump. - name: Extract lint-related deps from package-lock.json shell: bash run: | - jq '{packages: (.packages | to_entries | map(select(.key | test("eslint|^node_modules/(typescript|ts-api-utils)$"))) | from_entries)}' package-lock.json > lint-deps-lock.json + jq '{packages: (.packages | to_entries | map(select(.key | test("eslint|espree|acorn|^node_modules/(typescript|ts-api-utils)$"))) | from_entries)}' package-lock.json > lint-deps-lock.json # The setupNode sticky disk persists all of node_modules between runs, including # node_modules/.cache/eslint. Clear it so the restore step below is the only cache