Core plugin object structure and metadata for integrating with ESLint. The main export provides access to all plugin capabilities including configurations, rules, and processors.
The primary plugin export that ESLint uses to access all functionality.
/**
* Main ESLint Plugin Vue export
* Contains all configurations, rules, processors, and metadata
*/
const eslintPluginVue: VueESLintPlugin;
interface VueESLintPlugin {
/** Plugin metadata including name and version */
meta: PluginMeta;
/** Pre-built configuration presets for different Vue versions */
configs: PluginConfigs;
/** All 266 linting rules provided by the plugin */
rules: PluginRules;
/** File processors for handling .vue files */
processors: PluginProcessors;
}Basic plugin information extracted from package.json.
/**
* Plugin metadata object
* Provides name and version information for ESLint
*/
interface PluginMeta {
/** Package name: "eslint-plugin-vue" */
name: string;
/** Current package version */
version: string;
}Usage Example:
import eslintPluginVue from "eslint-plugin-vue";
console.log(eslintPluginVue.meta.name); // "eslint-plugin-vue"
console.log(eslintPluginVue.meta.version); // "10.4.0"Container for all configuration presets supporting both legacy and flat config formats.
/**
* All available configuration presets
* Includes Vue 2/3 variants and different recommendation levels
*/
interface PluginConfigs {
// Base configurations
/** Base parser configuration for Vue files */
base: LegacyConfig;
// Vue 3 legacy configs
/** Essential rules for Vue 3 - prevents errors */
essential: LegacyConfig;
/** Strongly recommended rules for Vue 3 - improves readability */
"strongly-recommended": LegacyConfig;
/** Recommended rules for Vue 3 - best practices */
recommended: LegacyConfig;
// Vue 2 legacy configs
/** Essential rules for Vue 2 - prevents errors */
"vue2-essential": LegacyConfig;
/** Strongly recommended rules for Vue 2 - improves readability */
"vue2-strongly-recommended": LegacyConfig;
/** Recommended rules for Vue 2 - best practices */
"vue2-recommended": LegacyConfig;
// Flat configs (ESLint 9+)
/** Base parser configuration for Vue files (flat config) */
"flat/base": FlatConfig[];
/** Essential rules for Vue 3 (flat config) */
"flat/essential": FlatConfig[];
/** Strongly recommended rules for Vue 3 (flat config) */
"flat/strongly-recommended": FlatConfig[];
/** Recommended rules for Vue 3 (flat config) */
"flat/recommended": FlatConfig[];
/** Essential rules for Vue 2 (flat config) */
"flat/vue2-essential": FlatConfig[];
/** Strongly recommended rules for Vue 2 (flat config) */
"flat/vue2-strongly-recommended": FlatConfig[];
/** Recommended rules for Vue 2 (flat config) */
"flat/vue2-recommended": FlatConfig[];
// Format-agnostic configs
/** Configuration excluding layout/formatting rules */
"no-layout-rules": LegacyConfig;
}Container for all 284 linting rules organized by functionality.
/**
* All linting rules provided by the plugin
* Each rule is an ESLint-compatible rule object
*/
interface PluginRules {
// Template formatting rules (23 rules)
"array-bracket-newline": ESLintRule;
"array-bracket-spacing": ESLintRule;
"array-element-newline": ESLintRule;
"arrow-spacing": ESLintRule;
"block-spacing": ESLintRule;
"brace-style": ESLintRule;
"comma-dangle": ESLintRule;
"comma-spacing": ESLintRule;
"comma-style": ESLintRule;
"dot-location": ESLintRule;
"dot-notation": ESLintRule;
"func-call-spacing": ESLintRule;
"key-spacing": ESLintRule;
"keyword-spacing": ESLintRule;
"max-len": ESLintRule;
"object-curly-newline": ESLintRule;
"object-curly-spacing": ESLintRule;
"object-property-newline": ESLintRule;
"operator-linebreak": ESLintRule;
"quote-props": ESLintRule;
"space-in-parens": ESLintRule;
"space-infix-ops": ESLintRule;
"space-unary-ops": ESLintRule;
"template-curly-spacing": ESLintRule;
// Vue-specific formatting rules (35 rules)
"attribute-hyphenation": ESLintRule;
"attributes-order": ESLintRule;
"block-order": ESLintRule;
"block-tag-newline": ESLintRule;
"component-definition-name-casing": ESLintRule;
"component-name-in-template-casing": ESLintRule;
"first-attribute-linebreak": ESLintRule;
"html-closing-bracket-newline": ESLintRule;
"html-closing-bracket-spacing": ESLintRule;
"html-comment-content-newline": ESLintRule;
"html-comment-content-spacing": ESLintRule;
"html-comment-indent": ESLintRule;
"html-end-tags": ESLintRule;
"html-indent": ESLintRule;
"html-quotes": ESLintRule;
"html-self-closing": ESLintRule;
"max-attributes-per-line": ESLintRule;
"multiline-html-element-content-newline": ESLintRule;
"mustache-interpolation-spacing": ESLintRule;
"padding-line-between-blocks": ESLintRule;
"padding-line-between-tags": ESLintRule;
"prop-name-casing": ESLintRule;
"script-indent": ESLintRule;
"singleline-html-element-content-newline": ESLintRule;
"slot-name-casing": ESLintRule;
"static-class-names-order": ESLintRule;
"v-bind-style": ESLintRule;
"v-for-delimiter-style": ESLintRule;
"v-on-event-hyphenation": ESLintRule;
"v-on-handler-style": ESLintRule;
"v-on-style": ESLintRule;
"v-slot-style": ESLintRule;
// And 226 more rules covering component structure, directives,
// lifecycle, composition API, props/emits, reactivity, and best practices
[ruleName: string]: ESLintRule;
}File processors for handling Vue Single File Components.
/**
* File processors for Vue Single File Components
* Handles .vue file parsing and comment directive processing
*/
interface PluginProcessors {
/** Processor for .vue file extension */
".vue": ESLintProcessor;
/** Alias processor accessible as 'vue' */
vue: ESLintProcessor;
}interface ESLintRule {
/** Rule metadata and configuration */
meta: RuleMeta;
/** Rule implementation function */
create: (context: RuleContext) => RuleListener;
}
interface RuleMeta {
/** Rule category: problem, suggestion, or layout */
type: "problem" | "suggestion" | "layout";
/** Rule documentation and metadata */
docs: {
/** Human-readable description of the rule */
description: string;
/** Vue configuration categories this rule belongs to */
categories?: string[];
/** URL to rule documentation */
url: string;
/** Information about extended core/stylistic rules */
extensionSource?: {
url: string;
name: string;
};
};
/** Whether the rule can auto-fix issues */
fixable?: "code" | "whitespace";
/** JSON schema for rule options */
schema?: JSONSchema;
/** Whether the rule is deprecated */
deprecated?: boolean;
/** Rules that replace this deprecated rule */
replacedBy?: string[];
}
interface ESLintProcessor {
/** Transform file content before linting */
preprocess: (code: string, filename: string) => string[];
/** Process lint messages after linting */
postprocess: (messages: LintMessage[][]) => LintMessage[];
/** Whether processor supports auto-fixing */
supportsAutofix: boolean;
/** Processor metadata */
meta: ProcessorMeta;
}
interface ProcessorMeta {
name: string;
version: string;
}
type JSONSchema = object;
type RuleListener = Record<string, (node: any) => void>;
type LintMessage = {
ruleId: string | null;
severity: number;
message: string;
line: number;
column: number;
nodeType?: string;
messageId?: string;
endLine?: number;
endColumn?: number;
fix?: EditInfo;
suggestions?: SuggestionResult[];
};