From ea074b4291efdc4898c615c01ccb75edfa722782 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:33:02 +0200 Subject: [PATCH 1/6] chore: adjust gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4284058f4..74249bfff 100644 --- a/.gitignore +++ b/.gitignore @@ -43,8 +43,11 @@ testem.log .DS_Store Thumbs.db +# generated eslint reports +.eslint + # generated Code PushUp reports -/.code-pushup +.code-pushup # Nx workspace cache .nx From 3e84cfa8ac5695dd948dfcde6a0e440a282e3d70 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:34:01 +0200 Subject: [PATCH 2/6] chore: add lint-report to default targets --- nx.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nx.json b/nx.json index 99e48af53..54340c1d9 100644 --- a/nx.json +++ b/nx.json @@ -46,9 +46,9 @@ "lint": { "inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"], "executor": "@nx/linter:eslint", - "outputs": ["{options.outputFile}"], "cache": true, "options": { + "errorOnUnmatchedPattern": false, "maxWarnings": 0, "lintFilePatterns": [ "{projectRoot}/**/*.ts", @@ -56,6 +56,22 @@ ] } }, + "lint-report": { + "inputs": ["default", "{workspaceRoot}/eslint.config.?(c)js"], + "outputs": ["{projectRoot}/.eslint/eslint-report*.json"], + "cache": true, + "executor": "@nx/linter:eslint", + "options": { + "errorOnUnmatchedPattern": false, + "maxWarnings": 0, + "format": "json", + "outputFile": "{projectRoot}/.eslint/eslint-report.json", + "lintFilePatterns": [ + "{projectRoot}/**/*.ts", + "{projectRoot}/package.json" + ] + } + }, "nxv-pkg-install": { "parallelism": false }, From 4d8d573b4223e16d5a4ab3f11eea7c5641e80a87 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:34:35 +0200 Subject: [PATCH 3/6] chore: add lint-report target to publishable projects --- packages/ci/project.json | 1 + packages/cli/project.json | 1 + packages/core/project.json | 1 + packages/create-cli/project.json | 1 + packages/models/project.json | 1 + packages/nx-plugin/project.json | 9 +++++++++ packages/plugin-coverage/project.json | 1 + packages/plugin-eslint/project.json | 1 + packages/plugin-js-packages/project.json | 1 + packages/plugin-jsdocs/project.json | 1 + packages/plugin-lighthouse/project.json | 1 + packages/plugin-typescript/project.json | 1 + packages/utils/project.json | 1 + 13 files changed, 21 insertions(+) diff --git a/packages/ci/project.json b/packages/ci/project.json index 9215f87b3..b6bdeab2c 100644 --- a/packages/ci/project.json +++ b/packages/ci/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/cli/project.json b/packages/cli/project.json index bc3b384a7..733186813 100644 --- a/packages/cli/project.json +++ b/packages/cli/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {}, "run-help": { diff --git a/packages/core/project.json b/packages/core/project.json index 4924717c5..75fc9f380 100644 --- a/packages/core/project.json +++ b/packages/core/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/create-cli/project.json b/packages/create-cli/project.json index c2bc6ef60..813f42b91 100644 --- a/packages/create-cli/project.json +++ b/packages/create-cli/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "exec-node": { "dependsOn": ["build"], diff --git a/packages/models/project.json b/packages/models/project.json index 15981781f..58a71cd27 100644 --- a/packages/models/project.json +++ b/packages/models/project.json @@ -18,6 +18,7 @@ ] }, "lint": {}, + "lint-report": {}, "unit-test": {} }, "tags": ["scope:shared", "type:util", "publishable"] diff --git a/packages/nx-plugin/project.json b/packages/nx-plugin/project.json index 52c8f2290..63e15c1d4 100644 --- a/packages/nx-plugin/project.json +++ b/packages/nx-plugin/project.json @@ -41,6 +41,15 @@ ] } }, + "lint-report": { + "options": { + "lintFilePatterns": [ + "packages/nx-plugin/**/*.ts", + "packages/nx-plugin/package.json", + "packages/nx-plugin/generators.json" + ] + } + }, "unit-test": {}, "int-test": {} }, diff --git a/packages/plugin-coverage/project.json b/packages/plugin-coverage/project.json index edb62346f..031d65697 100644 --- a/packages/plugin-coverage/project.json +++ b/packages/plugin-coverage/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/plugin-eslint/project.json b/packages/plugin-eslint/project.json index 241101850..eeae19055 100644 --- a/packages/plugin-eslint/project.json +++ b/packages/plugin-eslint/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/plugin-js-packages/project.json b/packages/plugin-js-packages/project.json index 9f0dc7789..63782308a 100644 --- a/packages/plugin-js-packages/project.json +++ b/packages/plugin-js-packages/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/plugin-jsdocs/project.json b/packages/plugin-jsdocs/project.json index 745540438..9f07a4761 100644 --- a/packages/plugin-jsdocs/project.json +++ b/packages/plugin-jsdocs/project.json @@ -7,6 +7,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} } diff --git a/packages/plugin-lighthouse/project.json b/packages/plugin-lighthouse/project.json index b93152ffb..468165a9c 100644 --- a/packages/plugin-lighthouse/project.json +++ b/packages/plugin-lighthouse/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {} }, "tags": ["scope:plugin", "type:feature", "publishable"] diff --git a/packages/plugin-typescript/project.json b/packages/plugin-typescript/project.json index 645259554..de10ea00e 100644 --- a/packages/plugin-typescript/project.json +++ b/packages/plugin-typescript/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "unit-test": {}, "int-test": {} }, diff --git a/packages/utils/project.json b/packages/utils/project.json index 021205deb..2953464ca 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -6,6 +6,7 @@ "targets": { "build": {}, "lint": {}, + "lint-report": {}, "perf": { "command": "npx tsx --tsconfig=../tsconfig.perf.json", "options": { From 9f41ba7a7e3120563e0d21cdde40efa0c223b096 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:35:30 +0200 Subject: [PATCH 4/6] chore: make code-pushup only lint the publishable projects --- code-pushup.preset.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/code-pushup.preset.ts b/code-pushup.preset.ts index af7633ea9..0b033bcd8 100644 --- a/code-pushup.preset.ts +++ b/code-pushup.preset.ts @@ -7,9 +7,10 @@ import coveragePlugin, { getNxCoveragePaths, } from './packages/plugin-coverage/src/index.js'; import eslintPlugin, { - eslintConfigFromAllNxProjects, eslintConfigFromNxProject, } from './packages/plugin-eslint/src/index.js'; +import type { ESLintTarget } from './packages/plugin-eslint/src/lib/config.js'; +import { nxProjectsToConfig } from './packages/plugin-eslint/src/lib/nx/projects-to-config.js'; import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js'; import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js'; import type { JsDocsPluginTransformedConfig } from './packages/plugin-jsdocs/src/lib/config.js'; @@ -156,6 +157,17 @@ export const jsDocsCoreConfig = ( ), }); +export async function eslintConfigFromPublishableNxProjects(): Promise< + ESLintTarget[] +> { + const { createProjectGraphAsync } = await import('@nx/devkit'); + const projectGraph = await createProjectGraphAsync({ exitOnError: false }); + return nxProjectsToConfig( + projectGraph, + project => project.tags?.includes('publishable') ?? false, + ); +} + export const eslintCoreConfigNx = async ( projectName?: string, ): Promise => ({ @@ -163,7 +175,7 @@ export const eslintCoreConfigNx = async ( await eslintPlugin( await (projectName ? eslintConfigFromNxProject(projectName) - : eslintConfigFromAllNxProjects()), + : eslintConfigFromPublishableNxProjects()), ), ], categories: eslintCategories, From 2272356c37cbdb7cefaa64861db2f888d5d5c72c Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:49:00 +0200 Subject: [PATCH 5/6] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6863fbcb4..3afda2fa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: - name: Install dependencies run: npm ci - name: E2E test affected projects - run: npx nx affected -t e2e-test --parallel=1 + run: npx nx affected -t e2e-test --skipNxCache --parallel=1 build: runs-on: ubuntu-latest From 116ad4b2b9ad0a4d1d7c94932b0c434378e48d24 Mon Sep 17 00:00:00 2001 From: Michael Hladky Date: Fri, 22 Aug 2025 01:49:16 +0200 Subject: [PATCH 6/6] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3afda2fa1..6863fbcb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: - name: Install dependencies run: npm ci - name: E2E test affected projects - run: npx nx affected -t e2e-test --skipNxCache --parallel=1 + run: npx nx affected -t e2e-test --parallel=1 build: runs-on: ubuntu-latest