Skip to content

feat!: inline projects extend the root config by default#10750

Open
sheremet-va wants to merge 17 commits into
mainfrom
feat/extends-default-true
Open

feat!: inline projects extend the root config by default#10750
sheremet-va wants to merge 17 commits into
mainfrom
feat/extends-default-true

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Jul 9, 2026

Copy link
Copy Markdown
Member

Description

extends now defaults to true: inline projects inherit all options from the root config, including plugins. Set extends: false to keep the project isolated.

  • name and projects are never inherited. globalSetup is not inherited from the root config because it already runs once per test run (extending a non-root config still inherits it). The project's own tags replace the inherited array.
  • Extending projects also inherit the programmatic config passed to createVitest/startVitest, so inheritance works even when there is no root config file. Root plugins from the programmatic config are not inherited because their instances are owned by the root server. The programmatic browser configuration is also not inherited: its instances describe a single project, and inheriting them would create duplicate instance names (the --browser flags have the same guard).
  • The hardcoded experimental options propagation is removed; the values are inherited like everything else, and extends: false discards them. --experimental.* CLI flags are applied to every project like the other project-level CLI flags.

Projects referenced as config files or directories are not affected. Documented in the migration guide and the projects guide.

Resolves #7225


Stacked on #10823, which deduplicates the run-level option copies and adds the "Project Configuration Resolution" section to the advanced guide; this PR updates that section for the new semantics.

@github-actions github-actions Bot added the maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control label Jul 9, 2026
@vitest-dev vitest-dev deleted a comment from github-actions Bot Jul 9, 2026
@sheremet-va sheremet-va removed the maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control label Jul 9, 2026
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 33bb3d6
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a6246e9e49db2000999034c
😎 Deploy Preview https://deploy-preview-10750--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread packages/vitest/src/node/projects/resolveProjects.ts Outdated
@sheremet-va
sheremet-va marked this pull request as draft July 10, 2026 09:42
@sheremet-va
sheremet-va marked this pull request as ready for review July 23, 2026 16:07
@sheremet-va
sheremet-va changed the base branch from main to refactor/config-propagation July 23, 2026 16:52
…true

# Conflicts:
#	packages/vitest/src/node/config/propagation.ts
#	packages/vitest/src/node/plugins/workspace.ts
#	packages/vitest/src/node/projects/resolveProjects.ts
}
}

/**

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is a bit of a mind fck, but I don't see a better way. viteOverrides were a mistake!

macarie
macarie previously approved these changes Jul 24, 2026

@macarie macarie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good from what I can tell (given my limited knowledge of this part) 👍🏼


::: tip Referencing the Current Config
If you want to keep the user configuration, you can specify the `extends` property. All other properties will be merged with the user defined config.
Inline configurations inherit the root config by default. If you want to inherit the configuration of a specific project instead, set the `extends` property to its config file. All other properties will be merged with the user defined config.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure the relationship between "a specific project" and "its config file" (like why is it a different config file?) is clear, but I have no idea how to word it differently...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Changed to

If you want to inherit a specific configuration file instead, set the extends property to its path

Base automatically changed from refactor/config-propagation to main July 24, 2026 11:47
@sheremet-va
sheremet-va dismissed macarie’s stale review July 24, 2026 11:47

The base branch was changed.

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.

[v3] Automatically inherit common test config in inline projects

2 participants