Current Behavior
When generating an eslint project, the code runs isMigrationToMonorepoNeeded to see if it should split a root eslint.config.mjs into eslint.config.mjs and eslint.base.config.mjs. This means that conversion to monorepo will not happen if you create a workspace with a root project.json and a new project before committing the tree. This results in a delay for when that file is created. Additionally, when base is created, it does not copy custom rules from the original file. This means that any code that adds rules to the root eslint file needs to know when base is created so that it can move rules over.
Expected Behavior
isMigrationToMonorepoNeeded should use getProjects instead of the project graph. getProjects accurately reflects the state of the project in the working tree. projectGraph only reflects the graph as it is on the filesystem. Since nx has access to the tree here and only needs properties available from getProjects, that's what it should use.
GitHub Repo
No response
Steps to Reproduce
- Create an nx 20.8.4 workspace with a root project.json file that does not have a lint target
- Run a generator that calls the lint project generator on the root project
- In that same generator, add a new project (addProjectConfiguration)
- Run the lint generator on the new project
- Note that the eslint.config.mjs does not get split up
The tree should have written now
- Now run the lint generator again on the new project - magically it splits the file now
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
Current Behavior
When generating an eslint project, the code runs isMigrationToMonorepoNeeded to see if it should split a root eslint.config.mjs into eslint.config.mjs and eslint.base.config.mjs. This means that conversion to monorepo will not happen if you create a workspace with a root project.json and a new project before committing the tree. This results in a delay for when that file is created. Additionally, when base is created, it does not copy custom rules from the original file. This means that any code that adds rules to the root eslint file needs to know when base is created so that it can move rules over.
Expected Behavior
isMigrationToMonorepoNeeded should use getProjects instead of the project graph. getProjects accurately reflects the state of the project in the working tree. projectGraph only reflects the graph as it is on the filesystem. Since nx has access to the tree here and only needs properties available from getProjects, that's what it should use.
GitHub Repo
No response
Steps to Reproduce
The tree should have written now
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response