Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Repo: address issues introduced by updatednx configuration #11229

Open
Labels
repo maintenancethings to do with maintenance of the repo, and not with code/docstriageWaiting for team members to take a look
@aryaemami59

Description

@aryaemami59

Suggestion

Overview

There are several issues related to inferred plugin options, unexpected overrides, and missing configuration context in the current setup. This issue summarizes and clarifies those points while referencingthis video made by@JamesHenry.


1. Plugin Option Overriding

  • Some inferred plugins provide default options that unintentionally override explicitly set options from other plugins.

For example,@nx/vite/plugin has a defaulttypecheckTargetName of"typecheck", which overrides thetargetName we explicitly set for@nx/js/typescript.

Initially, this was mitigated by explicitly overriding the value:

{"plugin":"@nx/vite/plugin","include": ["packages/*"],"options": {"typecheckTargetName":"vite:typecheck"  }}

However, the current config no longer specifies that override:

{"plugin":"@nx/js/typescript","options": {"typecheck": {"targetName":"typecheck"    }  }},{"plugin":"@nx/vite/plugin","options": {// Implicit: "typecheckTargetName": "typecheck"  }}

This results in the@nx/vite/plugin inferring atypecheck target by detectingvitest.config.mts, whichoverrides the one from@nx/js/typescript.

You can clearly see this misalignment in the output fromnx graph:

Current (Incorrect):

Incorrect graph

Expected (Correct):

Correct graph

This is a serious issue since runningtsc -p tsconfig.json --noEmit ends uptype-checking nothing, because ourtsconfig.json uses emptyfiles andinclude arrays, relying instead on project references. You can confirm this by introducing a type error and rerunningtypecheck.


2.@nx/eslint:lint – Config Path Was Correct

  • In the video (14:13), it's mentioned that the value ofoptions.eslintConfig (set to{workspaceRoot}/eslint.config.mjs) is incorrect. However, this was in factcorrect. We only have a singleeslint.config.mjs file, and it's at the root of the workspace.

3. Type Tests and Whyutils:test Depends onbuild andtypecheck

  • At 19:45, the video questions whyutils:test depends on^build. This dependency, along withtypecheck, was actuallyintentional and necessary for runningtype-tests usingvitest. These tests require the workspace's dependencies to be built beforehand, hence the original configuration:
"test": {"dependsOn": ["^build","typecheck"]}

Currently, only a few packages (e.g.,ast-spec,utils) include type tests. In those workspaces:

  • typecheck.enabled was previously set totrue invitest.config.mts.
  • Thetypecheck.tsconfig was previously set to the localtsconfig.spec.json.

Whilevitest's type-checker is essentially a wrapper aroundtsc, there are some differences, which is why the scope of files to check was narrowed in the rootvitest.config.base.mts file.


4. Missing--config=vitest.config.mts Flag

  • In the PR that simplified the configuration, the--config=vitest.config.mts flag was not carried over into the updatednx.json. While not strictly required, re-adding it would avoidvitest's config file lookup and offer a slight performance improvement.

Additional Info

I will submit a PR for this shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    repo maintenancethings to do with maintenance of the repo, and not with code/docstriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp