Describe the bug
The nested vite-plus config in packages/some-package/vite.config.ts defines ignorePatterns: ["tests/fixtures/**/*"] to exclude test fixtures from linting. The root vite.config.ts defines lint rules including import/no-commonjs. When vite-plus merges these configs, it applies the root's import/no-commonjs rule to the sub-package but does not respect the sub-package's ignorePatterns. As a result, tests/fixtures/should-ignore-this.cjs gets linted and fails with an import/no-commonjs error, even though it should be ignored.
Expected: Files matching ignorePatterns in the nested config are excluded from linting.
Actual: ignorePatterns from the nested config is not applied (or is overridden during config merging), causing fixture files to be linted against inherited rules.
Reproduction
https://github.com/rajzik/vite-plus-repro
Steps to reproduce
- Create a monorepo with vite-plus and turbo as dev dependencies.
- Define a root
vite.config.ts with a lint rule:
import { defineConfig } from "vite-plus";
export default defineConfig({
lint: {
plugins: ["import"],
rules: {
"import/no-commonjs": "error",
},
},
});
- Create a nested package at
packages/some-package/ with its own vite.config.ts that sets ignorePatterns:
import { defineConfig } from "vite-plus";
export default defineConfig({
lint: {
options: {
denyWarnings: true,
reportUnusedDisableDirectives: "error",
typeAware: true,
typeCheck: true,
},
ignorePatterns: ["tests/fixtures/**/*"],
},
});
- Add a CommonJS fixture file at
packages/some-package/tests/fixtures/should-ignore-this.cjs that uses module.exports.
- Run
pnpm install.
- Run
pnpm run lint.
System Info
VITE+ - The Unified Toolchain for the Web
Environment:
Version 24.14.0
Source lts
Tool Paths:
node /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/node
npm /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/npm
npx /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/npx
vp v0.1.12
Local vite-plus:
vite-plus v0.1.12
Tools:
vite v8.0.0
rolldown v1.0.0-rc.9
vitest v4.1.0
oxfmt v0.40.0
oxlint v1.55.0
oxlint-tsgolint v0.17.0
tsdown v0.21.3
Environment:
Package manager pnpm v10.32.1
Node.js Not found
Used Package Manager
pnpm
Logs
Validations
Describe the bug
The nested vite-plus config in
packages/some-package/vite.config.tsdefines ignorePatterns: ["tests/fixtures/**/*"]to exclude test fixtures from linting. The root vite.config.ts defines lint rules including import/no-commonjs. When vite-plus merges these configs, it applies the root's import/no-commonjs rule to the sub-package but does not respect the sub-package's ignorePatterns. As a result, tests/fixtures/should-ignore-this.cjs gets linted and fails with an import/no-commonjs error, even though it should be ignored.Expected: Files matching ignorePatterns in the nested config are excluded from linting.
Actual: ignorePatterns from the nested config is not applied (or is overridden during config merging), causing fixture files to be linted against inherited rules.
Reproduction
https://github.com/rajzik/vite-plus-repro
Steps to reproduce
vite.config.tswith a lint rule:packages/some-package/with its ownvite.config.tsthat sets ignorePatterns:packages/some-package/tests/fixtures/should-ignore-this.cjsthat uses module.exports.pnpm install.pnpm run lint.System Info
VITE+ - The Unified Toolchain for the Web Environment: Version 24.14.0 Source lts Tool Paths: node /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/node npm /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/npm npx /Users/jansilhan/.vite-plus/js_runtime/node/24.14.0/bin/npx vp v0.1.12 Local vite-plus: vite-plus v0.1.12 Tools: vite v8.0.0 rolldown v1.0.0-rc.9 vitest v4.1.0 oxfmt v0.40.0 oxlint v1.55.0 oxlint-tsgolint v0.17.0 tsdown v0.21.3 Environment: Package manager pnpm v10.32.1 Node.js Not foundUsed Package Manager
pnpm
Logs
Validations