-
Notifications
You must be signed in to change notification settings - Fork 119
Description
Describe the bug
The ESLint checker in vite-plugin-checker seemingly does not respect Vite's resolve.alias configuration, causing files in aliased packages to be skipped during linting in development mode. While TypeScript checking works correctly (presumably because paths are configured in tsconfig.json), ESLint fails to lint files that are imported through aliases.
In our monorepo setup, we have a common package that is aliased as @my-org/common in the Vite config. The TypeScript checker correctly processes these files, but ESLint does not lint them during development, even though running the same ESLint command manually works correctly.
Reproduction
Set up a monorepo with multiple packages:
project/
├── eslint.config.mjs
├── packages/
│ ├── app/
│ │ ├── vite.config.mts
│ │ └── src/
│ └── common/
│ └── src/
Configure Vite with resolve aliases pointing to other packages:
resolve: {
alias: {
'@my-org/common': path.resolve(__dirname, '../common/src'),
}
}Configure vite-plugin-checker with ESLint:
checker({
typescript: true,
eslint: {
useFlatConfig: true,
lintCommand: `eslint . --config ../../eslint.config.mjs`,
dev: {
logLevel: ['error'],
},
},
})Import files from the aliased package in your main package
Introduce ESLint errors in the aliased package files
Start Vite dev server - notice that ESLint errors from aliased files are not reported
Run the same ESLint command manually - notice that errors are reported correctly.
Expected behavior
ESLint should lint all files specified in the lintCommand, including those in aliased packages, just as it does when run manually. The plugin should follow Vite's resolve aliases when determining which files to process.
The TypeScript checker already works correctly by respecting the compilerOptions.paths in tsconfig.json, so ESLint should have similar behavior.
Actual Behavior
Files in aliased packages are silently ignored during development
No errors or warnings are shown indicating files are being skipped
The same ESLint command works correctly when run manually
TypeScript checking works fine for the same files
System Info
System:
OS: macOS 15.5
CPU: (8) arm64 Apple M1 Pro
Memory: 98.00 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.4.1 - /opt/homebrew/bin/node
npm: 11.4.2 - /opt/homebrew/bin/npm
pnpm: 9.12.3 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 138.0.7204.184
Safari: 18.5
npmPackages:
vite-plugin-checker: 0.10.2Additional context
This issue is similar to #159 which describes a similar problem (albeit, with typescript)
The issue only affects development mode linting; manual ESLint execution works correctly
TypeScript checking works properly because aliases are configured in both Vite config and tsconfig.json paths
The problem occurs silently - no indication that files are being skipped
Current workaround
Adding the aliased package path directly to paths listed in the lintCommand
Validations
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.