Registry / devops / volar-service-eslint

volar-service-eslint

JSON →
library0.0.17jsnpmunverified

Integrates ESLint linting into Volar's language service for virtual file systems. Current stable version 0.0.17, updated frequently as part of the Volar services monorepo. It leverages Volar's virtual code support to provide accurate lint diagnostics for embedded languages (e.g., Vue SFCs, MDX). Unlike standalone ESLint, it operates within Volar's incremental document model, enabling real-time linting results in editor extensions. Requires @volar/language-service ~1.11 and ESLint as peer dependencies. Ships TypeScript types.

npm install volar-service-eslint
INSTALL
IMPORT
SIG · VOLAR-SERVICE-ESLI
V
volar-service-eslint
devopsjavascriptv0.0.17
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create
✓ import { create } from 'volar-service-eslint'
✗ const create = require('volar-service-eslint').create
ESM-only package; use dynamic import in CJS environments
Default export
✓ import volarEslint from 'volar-service-eslint'
✗ const volarEslint = require('volar-service-eslint').default
Package exposes both named and default export; default is a factory function
VolarEslintService
✓ import type { VolarEslintService } from 'volar-service-eslint'
✗ import { VolarEslintService } from 'volar-service-eslint'
Type import only; not a runtime export

Registers the ESLint service with Volar's language service and shows how to trigger lint validation.

import { createLanguageService } from '@volar/language-service'; import { create } from 'volar-service-eslint'; const languageService = createLanguageService( // ... your Volar language service host ); languageService.register(create({ // ESLint options eslint: require('eslint'), lintFileOptions: { documentSelector: ['vue', 'typescript', 'javascript'], }, })); // Then use languageService.doValidation(...) to get lint results
Debug
Known issues
gotchaESLint module must be passed explicitly; it is not auto-resolved.
fix
Ensure you pass 'eslint' as the module or import it.
affects: >=0.0.0
gotchaService only works with Volar language service instances, not standalone ESLint usage.
fix
Use directly with ESLint for non-Volar setups.
affects: >=0.0.0
deprecatedOld API using 'register' with 'createEslintService' is deprecated.
fix
Upgrade to v0.0.10+ and use 'create' from 'volar-service-eslint'.
affects: <0.0.10
Errors
Common errors & fixes
Cannot find module '@volar/language-service'
Missing peer dependency @volar/language-service.
fix
Run 'npm install @volar/language-service' or add it to your dependencies.
TypeError: eslint.linter is not a function
Passed incorrect ESLint object (likely a configuration instead of the eslint module).
fix
Make sure to pass the actual eslint module: { eslint: require('eslint') }
No overload matches this call.
TypeScript error due to mismatched @volar/language-service version.
fix
Ensure @volar/language-service matches the peer dependency ~1.11.
Upgrade
Version history
0.0.17latest on npm
Audit
Dependencies
@volar/language-servicerequiredCore Volar language service integration
eslintrequiredESLint core API for linting
Agent activity
8 hits · last 30 days
node
8
Resources
volar-service-eslint — npm install volar-service-eslint · libregistry