From f71a73c29d0c1ce75a0f1c49e28e49c0b63d0038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Thu, 11 Dec 2025 17:54:36 +0100 Subject: [PATCH 1/3] fix(plugin-eslint): replace static @nx/devkit import --- packages/plugin-eslint/src/lib/nx/find-project-with-deps.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/plugin-eslint/src/lib/nx/find-project-with-deps.ts b/packages/plugin-eslint/src/lib/nx/find-project-with-deps.ts index fa90f950c..478ad118d 100644 --- a/packages/plugin-eslint/src/lib/nx/find-project-with-deps.ts +++ b/packages/plugin-eslint/src/lib/nx/find-project-with-deps.ts @@ -1,5 +1,4 @@ -import { logger } from '@nx/devkit'; -import { pluralizeToken } from '@code-pushup/utils'; +import { logger, pluralizeToken } from '@code-pushup/utils'; import type { ESLintTarget } from '../config.js'; import { formatMetaLog } from '../meta/format.js'; import { nxProjectsToConfig } from './projects-to-config.js'; From 2ae630dec7db1d953b0dffdd972987f88e4fcae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Thu, 11 Dec 2025 17:55:27 +0100 Subject: [PATCH 2/3] ci: catch mistaken logger imports with eslint --- eslint.config.js | 17 +++++++++++++++++ packages/nx-plugin/eslint.config.js | 2 ++ 2 files changed, 19 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index cf20609ed..a655fc8f5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -146,4 +146,21 @@ export default tseslint.config( '**/*.md', ], }, + { + files: ['packages/**/*.ts'], + rules: { + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: '@nx/devkit', + importNames: ['logger'], + message: 'Please use logger from @code-pushup/utils instead.', + }, + ], + }, + ], + }, + }, ); diff --git a/packages/nx-plugin/eslint.config.js b/packages/nx-plugin/eslint.config.js index e732748e6..f0ea93505 100644 --- a/packages/nx-plugin/eslint.config.js +++ b/packages/nx-plugin/eslint.config.js @@ -34,6 +34,8 @@ module.exports = tseslint.config( 'warn', { styles: { 'node:path': { namespace: true } } }, ], + // `import { logger } from '@nx/devkit' is OK here + 'no-restricted-imports': 'off', }, }, { From c389aa148866b5a977b754c9e8efca293a2dd3a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Chalk?= Date: Thu, 11 Dec 2025 17:56:07 +0100 Subject: [PATCH 3/3] ci: invalidate nx cache when shared workspace config changes --- nx.json | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nx.json b/nx.json index 4f25228cc..c5d23e1ca 100644 --- a/nx.json +++ b/nx.json @@ -28,9 +28,16 @@ { "env": "NX_VERBOSE_LOGGING" }, { "externalDependencies": ["vitest"] } ], - "lint-eslint-inputs": [{ "externalDependencies": ["eslint"] }], - "typecheck-typescript-inputs": [{ "externalDependencies": ["typescript"] }], + "lint-eslint-inputs": [ + "{workspaceRoot}/eslint.config.js", + { "externalDependencies": ["eslint"] } + ], + "typecheck-typescript-inputs": [ + "{workspaceRoot}/tsconfig.base.json", + { "externalDependencies": ["typescript"] } + ], "code-pushup-inputs": [ + "{workspaceRoot}/code-pushup.preset.ts", { "env": "NODE_OPTIONS" }, { "env": "TSX_TSCONFIG_PATH" } ],