Skip to content

Conversation

mdjohns
Copy link

@mdjohns mdjohns commented Jul 24, 2025

This PR adds schemas for Nx's project.json and nx.json.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@hyperupcall
Copy link
Member

Thanks - unfortunately project.json is a bit too generic and will have too many false positives. Is there an alternative?

@mdjohns
Copy link
Author

mdjohns commented Jul 27, 2025

it looks like the conflict is with this:

{
"name": "project.json",
"description": "ASP.NET vNext project configuration file",
"fileMatch": ["project.json"],
"url": "https://www.schemastore.org/project.json",
"versions": {
"1.0.0-beta3": "https://www.schemastore.org/project-1.0.0-beta3.json",
"1.0.0-beta4": "https://www.schemastore.org/project-1.0.0-beta4.json",
"1.0.0-beta5": "https://www.schemastore.org/project-1.0.0-beta5.json",
"1.0.0-beta6": "https://www.schemastore.org/project-1.0.0-beta6.json",
"1.0.0-beta8": "https://www.schemastore.org/project-1.0.0-beta8.json",
"1.0.0-rc1": "https://www.schemastore.org/project-1.0.0-rc1.json",
"1.0.0-rc1-update1": "https://www.schemastore.org/project-1.0.0-rc1.json",
"1.0.0-rc2": "https://www.schemastore.org/project-1.0.0-rc2.json"
}
},

I'm not super familiar, but it appears to be a deprecated format according to Microsoft's docs (see here).

If I add project.json to the exclusions here, the validation succeeds for me locally:

"fileMatchConflict": [
// Name conflicts must be avoided. Do not add additional items here
"plugin.yml",
".jsbeautifyrc",
"info.json",
"manifest.json",
"*.cryproj"
],

@hyperupcall thoughts on this solution? There's a comment that does explicitly say not to add additional exclusions, but I think it's unlikely that someone would be using Nx and this (maybe deprecated) Nuget format.

{
"name": "Nx Project Schema",
"description": "Configuration file for the Nx CLI and project defaults. Documentation: https://nx.dev/reference/project-configuration",
"fileMatch": ["project.json"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you find a less generic name for the file match? Could you perhaps include the folder name that it always is located in, for instance?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I'm not sure of a way to do that. 😞
Nx is a language-agnostic tool for managing monorepos. Users can organize the packages within this monorepo however they want.

I understand that project.json is a fairly generic name, I'm just working with what Nx has already established.

The only solution I can think of is the one I proposed here: #4866 (comment)

But do let me know if you have any other ideas!
If we aren't able to find an acceptable solution, we may just have to close this PR, but I'm hoping we can.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, the proposed solution works to fix the errors, but I don't think it fixes the underlying conflict. But I'm definitely open to revisiting this after some time maybe when most people have migrated off of project.json (I'm not in the ASP.NET world)

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.

3 participants