Nested lint and format configs: share your use cases #2669
Replies: 1 comment 1 reply
|
Two setups, one where the current approach works and one where it has a sharp edge. Context for where this is coming from: I maintain https://github.com/kekkon-nexus/config, a published preset package for oxlint, oxfmt, tsconfig and commitlint, so my interest is less as a monorepo owner and more as someone whose presets end up in other people's repos. I also arrived here from #2698, so I have a mild bias toward nested lookup staying off. Where root-level composition worksThe preset repo itself: Bun workspace, import fmt from "@kekkon-nexus/config/oxfmt";
import base from "@kekkon-nexus/config/oxlint";
import vp from "@kekkon-nexus/config/oxlint/vite-plus";
export default defineConfig({
fmt: { ...fmt },
lint: { extends: [base, vp], options: { typeAware: true, typeCheck: true } },
});Granularity comes from the export map ( The reason I prefer keeping it explicit is testability. I can import a preset, inspect the resolved object, and assert on it. With implicit discovery my presets get merged by precedence rules I don't control and can't reproduce in a test, and a consumer's bug report becomes "which file won" instead of "here's the object you produced". Caveat: that tree is homogeneous TypeScript, so it has never stress-tested the polyglot case nested configs presumably exist for. Where the current behaviour is not neutralA different repo https://github.com/ryansuhartanto/koda-b8-phase3-project, a root with two git submodules. Each a standalone repo with its own
The root run covers the same files (31 + 36, plus two at the root) but applies one fewer rule, because both submodule configs register Right now that rule matches nothing, so the diagnostics from both paths are identical and the only signal is the rule count in the summary. With a submodule-specific rule that does fire, root CI passes while submodule CI fails, and nothing in the output explains the difference. I don't think nested discovery is the answer here, though. These aren't nested configs semantically: each submodule is the root of its own repo, resolves So the gap I'd point at isn't missing nested support, it's that a root run silently applies fewer rules than the per-repo runs with no indication it found configs it isn't using. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Vite+ currently reads lint and format settings from the root
vite.config.ts, withlint.overridesandfmt.overridesfor file- or package-specific settings. Nested lint and format configs are not currently supported.We're holding off on adding support for now. Some of the factors we're considering are implicit config discovery, configuration semantics, the context AI agents need to understand which settings apply, and the potential performance cost of finding and loading multiple configs. At the same time, we recognize that keeping package-specific context close to the code may have benefits.
The use cases we've heard so far haven't given us a strong enough reason to commit to those semantics. Waiting leaves room to add support later, and we'd like to hear why your project needs nested configs, especially where root-level overrides fall short.
Do you need nested lint or format configs? Or do you have other approves to improve the current solution? Tell us.
It would help to hear:
If the current approach works well for you, we'd like to hear that too. You don't need to propose an implementation—we're mainly interested in understanding your workflow and the reasons behind your preference.
All reactions