Skip to content

Vp lint ignores nested package ignorePattern #997

Description

@rajzik

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

  1. Create a monorepo with vite-plus and turbo as dev dependencies.
  2. Define a root vite.config.ts with a lint rule:
import{defineConfig}from"vite-plus";exportdefaultdefineConfig({lint: {plugins: ["import"],rules: {"import/no-commonjs": "error",},},});
  1. Create a nested package at packages/some-package/ with its own vite.config.ts that sets ignorePatterns:
import{defineConfig}from"vite-plus";exportdefaultdefineConfig({lint: {options: {denyWarnings: true,reportUnusedDisableDirectives: "error",typeAware: true,typeCheck: true,},ignorePatterns: ["tests/fixtures/**/*"],},});
  1. Add a CommonJS fixture file at packages/some-package/tests/fixtures/should-ignore-this.cjs that uses module.exports.
  2. Run pnpm install.
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions