Skip to content

fix(generator): infer ESLint targets by default - #215

Closed
tbinna wants to merge 1 commit into
mainfrom
codex/issue-212-eslint-inference
Closed

fix(generator): infer ESLint targets by default#215
tbinna wants to merge 1 commit into
mainfrom
codex/issue-212-eslint-inference

Conversation

@tbinna

@tbinna tbinna commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • migrate workspace lint targets to @nx/eslint/plugin inference while preserving cache inputs and output-file support
  • generate inferred ESLint targets by default while retaining the explicitly requested legacy executor path
  • cover inferred and legacy generator behavior, prevent hidden ESLint deprecation warnings, and make the generated-workspace e2e setup deterministic

Verification

  • pnpm exec prettier --check <changed files>
  • pnpm nx affected -t lint --base=main --head=HEAD --parallel=2 --skipNxCache
  • pnpm nx affected -t build --base=main --head=HEAD --parallel=2 --skipNxCache
  • NODE_OPTIONS=--throw-deprecation pnpm nx run-many -t test --all --parallel=2 --skipNxCache
  • pnpm nx e2e nx-forge-e2e --testPathPatterns=application.generator.spec.ts --runInBand --skipNxCache
  • independent standards and issue-spec reviews: no findings

Closes #212

Summary by CodeRabbit

  • New Features

    • Application projects now receive an automatically inferred lint target when ESLint plugin integration is available.
    • Generated projects continue to support build and test targets across supported bundlers and test runners.
  • Bug Fixes

    • Improved application generation so linting configuration is applied consistently based on workspace setup.
    • Added safeguards to identify deprecated lint executor usage during generated-app validation.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 55b7c469-99e8-4731-aefe-4f6c74bc3631

📥 Commits

Reviewing files that changed from the base of the PR and between 288af7c and dfac63c.

📒 Files selected for processing (13)
  • e2e/nx-forge-e2e/src/application.generator.spec.ts
  • e2e/nx-forge-e2e/src/utils/generate-forge-app.ts
  • e2e/nx-forge-e2e/src/utils/test-workspace.ts
  • nx.json
  • packages/nx-forge/project.json
  • packages/nx-forge/src/generators/application/generator.inference.spec.ts
  • packages/nx-forge/src/generators/application/generator.legacy.spec.ts
  • packages/nx-forge/src/generators/application/generator.spec.ts
  • packages/nx-forge/src/generators/application/generator.ts
  • packages/nx-forge/src/generators/application/test-utils/mock-plugin-inference.spec-helper.ts
  • packages/nx-forge/src/migrations/update-2-3-0/remove-implicit-custom-ui-dependencies.spec.ts
  • packages/nx-forge/tsconfig.lib.json
  • tools/docs/project.json
💤 Files with no reviewable changes (2)
  • packages/nx-forge/project.json
  • tools/docs/project.json

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change migrates workspace and generated Forge applications from explicit @nx/eslint:lint targets to @nx/eslint/plugin inference. It updates generator behavior, preserves legacy-mode coverage, removes project lint targets, and adds unit and end-to-end validation.

Changes

ESLint target inference

Layer / File(s) Summary
Workspace lint inference configuration
nx.json, packages/nx-forge/project.json, tools/docs/project.json
The workspace configures @nx/eslint/plugin with the lint target and removes explicit lint targets from the Forge and documentation projects.
Generator plugin-mode behavior
packages/nx-forge/src/generators/application/generator.ts, packages/nx-forge/src/generators/application/*.spec.ts, packages/nx-forge/src/generators/application/test-utils/*, packages/nx-forge/src/migrations/..., packages/nx-forge/tsconfig.lib.json
The application generator computes Jest and webpack plugin settings. Tests cover inferred targets, legacy @nx/eslint:lint output, and updated generator fixtures. Test helpers mock Nx graph internals and are excluded from library compilation.
End-to-end inference validation
e2e/nx-forge-e2e/src/application.generator.spec.ts, e2e/nx-forge-e2e/src/utils/*
End-to-end tests validate inferred lint configuration and lint output. Workspace scaffolding uses the current NX_VERSION, and generation fails when deprecated ESLint executor diagnostics appear.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to dfac6

The PR changes generated lint configuration and preserves the explicit legacy path without any actionable merge-blocking risk remaining after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ApplicationGenerator
  participant NxEslintPlugin
  participant NxCLI
  participant ESLint
  ApplicationGenerator->>NxEslintPlugin: Generate project without explicit lint target
  NxEslintPlugin->>NxCLI: Infer the lint target
  NxCLI->>ESLint: Run eslint with output-file and format options
  ESLint-->>NxCLI: Write lint-results.json
  NxCLI-->>ApplicationGenerator: Return lint command result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the primary change: default ESLint target inference in the generator.
Linked Issues check ✅ Passed The changes address issue #212 by configuring ESLint plugin inference, removing workspace-level deprecated lint targets, enabling inferred targets by default, preserving explicit legacy behavior, addi…
Out of Scope Changes check ✅ Passed The changes are within scope. Test helpers, e2e version pinning, migration updates, and TypeScript exclusions support the ESLint inference migration and its validation.
Full details: Linked Issues check

Explanation

The changes address issue #212 by configuring ESLint plugin inference, removing workspace-level deprecated lint targets, enabling inferred targets by default, preserving explicit legacy behavior, adding coverage, and making e2e validation deterministic.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 9 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tbinna
tbinna force-pushed the codex/issue-212-eslint-inference branch from dfac63c to 069dd9c Compare September 2, 2026 09:54
@tbinna tbinna closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate ESLint targets to @nx/eslint/plugin inference

1 participant