build: migrate Nx to 23.1.1 and fix all lint errors - #6
Merged
Conversation
Run `nx migrate latest` and apply 32 automated migrations. - @nx/* -> 23.1.1, typescript -> 6.0.3, vite -> 8.2.1, jest -> 30.3.0 - bump @types/node, esbuild and typescript-eslint to satisfy the new peer ranges required by vite 8 and typescript 6 - replace vitest.workspace.ts with vitest.config.ts test.projects - add ignoreDeprecations: "6.0" and explicit rootDir to tsconfigs - sync typescript project references via `nx sync` Fix a pre-existing bad reference path in testing/vitest-setup that resolved outside the repo, and regenerate the merged-profile snapshot for the new pretty-format trailing-comma output (content unchanged). Build, unit tests and integration tests pass. Pre-existing typecheck and lint failures in cpu-prof and dummy/app-1 are unaffected.
Bring `nx run-many -t lint` to zero errors across all 14 projects.
Code fixes:
- drop no-op callback defaults in nx-perf, use optional chaining
- replace empty arrow mock implementations with `() => undefined`
- remove stale `functional/no-let` disables (plugin is not installed)
- convert `a && b()` statements to if-blocks / optional calls
- widen `CommandModule<{}, T>` to `CommandModule<object, T>`
- unescape needless quotes, centralise the ANSI-stripping regex
- rewrite relative cross-project imports to package names
Config fixes:
- include vitest config files in testing/utils tsconfig.spec.json so the
type-aware parser can resolve them
- ignore vitest.*.config.* in cpu-prof dependency-checks instead of
promoting vitest/vite into the published package's dependencies
- register testing/* as npm workspaces so @push-based/testing-* actually
link into node_modules, and align their vitest/typescript versions with
the root to avoid stale nested installs
Verified: lint 0 errors, build 10/10, unit tests 142/142, typecheck
unchanged at the pre-existing 59-error baseline (58, no new errors).
actions/checkout v4 -> v7, actions/setup-node v4 -> v7 and nrwl/nx-set-shas v4 -> v5. The v4 releases run on the deprecated Node.js 20 action runtime and were being force-run on Node.js 24 by the runner. Note: the node-version: 20 input is the Node the build itself runs on, which is a separate concern and left unchanged.
There was a problem hiding this comment.
Pull request overview
This pull request migrates the monorepo to Nx 23.1.1 and updates related tooling (Vitest/Vite/TypeScript configs) while applying a workspace-wide lint autofix + targeted lint corrections to reach zero lint errors.
Changes:
- Upgrade Nx (and related tooling) to 23.1.1 and update workspace configuration/migrations.
- Update TypeScript/Vitest/Vite configuration across packages (including TS6
ignoreDeprecations, Vitest config/workspace changes, and Vite 8rolldownOptionsmigration). - Resolve eslint errors and update cross-project imports to use workspace package names.
Reviewed changes
Copilot reviewed 92 out of 95 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.workspace.ts | Remove legacy Vitest workspace file. |
| vitest.config.ts | Add root Vitest config with workspace projects globs. |
| tsconfig.json | Add TS6 ignoreDeprecations at root. |
| tsconfig.base.json | Update base TS compiler options for TS6 migration. |
| testing/vitest-setup/vite.config.ts | Migrate Vite build option to rolldownOptions. |
| testing/vitest-setup/tsconfig.spec.json | Fix TS references and add TS6 rootDir. |
| testing/vitest-setup/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| testing/vitest-setup/tsconfig.json | Add TS6 ignoreDeprecations. |
| testing/vitest-setup/package.json | Align Vitest version; add development export condition. |
| testing/utils/vitest.unit.config.ts | Switch to workspace package import for shared config. |
| testing/utils/vitest.integration.config.mts | Switch to workspace package import for shared config. |
| testing/utils/vite.config.ts | Migrate Vite build option to rolldownOptions. |
| testing/utils/tsconfig.spec.json | Include vitest config globs; add TS6 rootDir. |
| testing/utils/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| testing/utils/tsconfig.json | Add TS6 ignoreDeprecations and adjust references. |
| testing/utils/src/lib/execute-process.ts | Optional-call cleanup; remove stale eslint disables. |
| testing/utils/package.json | Bump TypeScript dependency; (still contains Nx vitest executors). |
| testing/setup/tsconfig.spec.json | Add TS6 rootDir. |
| testing/setup/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| testing/setup/tsconfig.json | Add TS6 ignoreDeprecations. |
| testing/setup/src/console.setup-file.ts | Replace empty mock fns with () => undefined. |
| testing/setup/package.json | Align Vitest version. |
| packages/nx-perf/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| packages/nx-perf/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| packages/nx-perf/tsconfig.json | Add TS6 ignoreDeprecations. |
| packages/nx-perf/src/utils.ts | Remove empty default callbacks; use optional chaining calls. |
| packages/cpu-prof/vitest.unit.config.ts | Switch to workspace package import for shared config. |
| packages/cpu-prof/vitest.integration.config.ts | Switch to workspace package import for shared config. |
| packages/cpu-prof/tsconfig.tsbuildinfo | Remove generated TS build info from repo. |
| packages/cpu-prof/tsconfig.lib.json | Add TS6 ignoreDeprecations; add new project references. |
| packages/cpu-prof/tsconfig.json | Add TS6 ignoreDeprecations; adjust references. |
| packages/cpu-prof/src/lib/merge-cpuprofile-files.unit.test.ts | Replace empty mock with () => undefined. |
| packages/cpu-prof/src/lib/execute-process.ts | Remove stale eslint disables for let. |
| packages/cpu-prof/src/lib/snapshots/merge-cpu-profile-files-merged-profile.json | Update file snapshot formatting/content. |
| packages/cpu-prof/src/index.ts | Export execute-process from package entrypoint. |
| packages/cpu-prof/src/cli/utils.ts | Prefer-const/no-inferrable-types lint fix. |
| packages/cpu-prof/src/cli/commands/trace-reduce/index.ts | Use CommandModule<object, …> for empty object type rule. |
| packages/cpu-prof/src/cli/commands/merge/index.ts | Use CommandModule<object, …> for empty object type rule. |
| packages/cpu-prof/src/cli/commands/merge/args-processor.ts | Prefer const destructure. |
| packages/cpu-prof/src/cli/commands/measure/builder.ts | Use CommandModule<object, …> for empty object type rule. |
| packages/cpu-prof/src/cli/commands/cpu-merge/index.ts | Use CommandModule<object, …> for empty object type rule. |
| packages/cpu-prof/src/cli/commands/cpu-merge/handler.ts | Replace unused expressions with explicit if blocks. |
| packages/cpu-prof/src/cli/commands/cpu-merge/args-processor.ts | Prefer const destructure. |
| packages/cpu-prof/src/cli/commands/cpu-measure/handler.ts | Prefer const for derived error message. |
| packages/cpu-prof/src/cli/commands/cpu-measure/builder.ts | Use CommandModule<object, …> for empty object type rule. |
| packages/cpu-prof/package.json | Switch to @nx/vitest:test; drop unused strip-ansi. |
| packages/cpu-prof/eslint.config.mjs | Ignore vitest.* config files for dependency checks. |
| packages/cpu-prof-e2e/vitest.e2e.config.ts | Switch to workspace package import for shared config. |
| packages/cpu-prof-e2e/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| packages/cpu-prof-e2e/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| packages/cpu-prof-e2e/tsconfig.json | Add TS6 ignoreDeprecations; adjust references. |
| packages/cpu-prof-e2e/test/help-command.e2e.test.ts | Import from package; regex escape cleanup. |
| packages/cpu-prof-e2e/test/cpu-merge-command.e2e.test.ts | Import from package. |
| packages/cpu-prof-e2e/test/cpu-measure-command.e2e.test.ts | Import from package; centralize color-code stripping. |
| package.json | Upgrade Nx toolchain; add testing/* workspaces. |
| nx.json | Reformat inputs; update vitest target defaults (executor still needs fix). |
| migrations.json | Update Nx migrations list to 23.1.1 migration set. |
| dummy/pkg-4/vite.config.ts | Migrate Vite build option to rolldownOptions. |
| dummy/pkg-4/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/pkg-4/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-4/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-4/package.json | Add tslib dependency. |
| dummy/pkg-3/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/pkg-3/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-3/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-3/package.json | Add tslib dependency. |
| dummy/pkg-3/jest.config.ts | Remove blanket eslint-disable header. |
| dummy/pkg-2/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/pkg-2/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-2/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-2/package.json | Swap runtime helper dependency to tslib. |
| dummy/pkg-2/jest.config.ts | Remove blanket eslint-disable header. |
| dummy/pkg-1/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/pkg-1/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-1/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-0/vite.config.ts | Migrate Vite build option to rolldownOptions. |
| dummy/pkg-0/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/pkg-0/tsconfig.lib.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-0/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/pkg-0/package.json | Add tslib dependency. |
| dummy/pkg-0/jest.config.ts | Remove blanket eslint-disable header. |
| dummy/app-1/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/app-1/tsconfig.app.json | Add TS6 ignoreDeprecations. |
| dummy/app-0/tsconfig.spec.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/app-0/tsconfig.json | Add TS6 ignoreDeprecations. |
| dummy/app-0/tsconfig.app.json | Add TS6 ignoreDeprecations. |
| dummy/app-0/jest.config.ts | Remove blanket eslint-disable header. |
| dummy/app-0-e2e/tsconfig.json | Add TS6 rootDir + ignoreDeprecations. |
| dummy/app-0-e2e/src/support/test-setup.ts | Remove blanket eslint-disable header. |
| dummy/app-0-e2e/src/support/global-teardown.ts | Remove blanket eslint-disable header. |
| dummy/app-0-e2e/jest.config.ts | Remove blanket eslint-disable header. |
| .prettierignore | Ignore new Nx self-healing folder. |
| .gitignore | Ignore Nx/Claude migration artifacts folders. |
Suppressed comments (2)
nx.json:88
@nx/vitest:vitestis not a valid executor (the vitest target executor is@nx/vitest:test). This will causeintegration-testto fail to resolve/run via Nx.
nx.json:93@nx/vitest:vitestis not a valid executor (the vitest target executor is@nx/vitest:test). This will causee2e-testto fail to resolve/run via Nx.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Adds a `test` job running `nx affected -t unit-test integration-test`. Two fixes were required to make those targets runnable at all: - testing-utils and cpu-prof-e2e declared the executor `@nx/vitest:vitest`, which does not exist, so the targets failed to resolve. Corrected to `@nx/vitest:test`. - testing-utils passed its vitest configs as project-relative paths, but the executor resolves `config` from the workspace root. Prefixed both with `testing/utils/`. Also drops `test` from the main job's affected list: no project defines a `test` target, so it silently matched nothing and no tests ever ran in CI. Verified after a clean `npm ci`: unit-test and integration-test pass for cpu-prof (142 + 4) and testing-utils (5).
- Replace invalid @nx/vitest:vitest executor with @nx/vitest:test in unit-test, integration-test and e2e-test target defaults (nx.json) - Pin typescript to exact 6.0.3 in testing/utils to match root and avoid nested TypeScript installs Addresses Copilot review comments on PR #6.
Folds the test targets into the existing affected run rather than standing up a separate job, so they share the one checkout, install and SHA setup: npx nx affected -t lint unit-test integration-test build Replaces the separate `test` job added in ff873cf.
The unit-test, integration-test and e2e-test targetDefaults reference a
`testFixtures` input that was never declared in namedInputs, so every
run of those targets aborted with "testFixtures is an invalid fileset".
Declares it as {projectRoot}/mocks/**/*.
Also refreshes package-lock.json for the exact typescript pin in
testing/utils.
Add a `nx format:check` step (id: format-check) to the main CI job so formatting drift fails the pipeline. The `/__snapshots__` entry in .prettierignore was root-anchored, so it never matched nested snapshot dirs. `nx format:write` therefore reformatted packages/cpu-prof/src/lib/__snapshots__, breaking the toMatchFileSnapshot assertion. Drop the leading slash so it matches at any depth, and apply the resulting formatting to the remaining files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the workspace from Nx 21.0.3 to 23.1.1 and brings
nx run-many -t lintto zero errors across all 14 projects.Commits
54048a3build: migrate nx 21.0.3 to 23.1.174acee0fix(lint): resolve all eslint errors across workspaceLint fixes
Auto-fixed via
--fix:prefer-const,no-inferrable-types, and@nx/dependency-checksin the four@dummy/pkg-*projects.By hand:
no-empty-function(nx-perf)() => {}callback defaults, call sites use optional chainingno-empty-function(test setup)mockImplementation(() => undefined)functional/no-let"rule not found"eslint-plugin-functionalis not installedno-unused-expressionsa && b()→ifblocks / optional calls{}empty-object typeCommandModule<object, …>no-control-regexremoveColorCodeshelper with one disable, matching the existing idiom in testing-utilsno-useless-escape"inside a regextesting/utils/vitest.unit.config.tstsconfig.spec.json@nx/enforce-module-boundariesTwo things worth reviewing
The
--fixfor@nx/dependency-checksmade a bad call oncpu-prof— it promotedvitest,vite, and@push-based/testing-vitest-setupinto the published package's runtimedependenciesbecause they are only used in vitest config files. That was reverted; insteadvitest.*.config.*is added toignoredFilesinpackages/cpu-prof/eslint.config.mjs. The fix did correctly drop the genuinely-unusedstrip-ansi.Fixing the module boundaries exposed a latent bug. The
testing/*packages were never listed in npmworkspaces, so@push-based/testing-*never linked intonode_modules— the rewritten imports failed to resolve, and so did a pre-existing@push-based/testing-utilsimport in cpu-prof's unit test. This PR registerstesting/*as workspaces and aligns those packages'vitest/typescriptversions with the root (they pinnedvitest@^1.3.1andtypescript@5.6.3, which installed stale nested copies and broketesting-vitest-setup:typecheck). Requires the lockfile change and annx syncfor TS project references.Verification
no-explicit-any/no-unused-vars)Pre-existing issues found but left alone
src/**/*.e2e.test.tsbut its tests live intest/— the e2e tests never run. Import rewrites there were verified by importing the packages directly instead.testing/utilsandcpu-prof-e2edeclare"executor": "@nx/vitest:vitest", which does not exist (valid name is@nx/vitest:test), sonx run-many -t unit-testfails to resolve.