1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//! # vize_patina
//!
//! Patina - The quality checker for Vize.
//! Linter for Vue.js Single File Components.
//!
//! ## Name Origin
//!
//! **Patina** (/ˈpætɪnə/) refers to the greenish layer that forms on copper,
//! bronze, and similar metals through oxidation over time. In art and antiques,
//! patina is highly valued as it indicates authenticity, age, and quality.
//! `vize_patina` examines Vue SFC code to ensure its quality and authenticity.
//!
//! ## Features
//!
//! - Rich diagnostic output with code snippets and suggestions (like oxlint)
//! - eslint-plugin-vue compatible rules
//! - LSP-ready design for integration with vize_maestro
//!
//! ## Usage
//!
//! ```rust,ignore
//! use vize_patina::{Linter, OutputFormat, format_results};
//!
//! let linter = Linter::new();
//! let source = r#"<template><div v-for="item in items">{{ item }}</div></template>"#;
//! let result = linter.lint_template(source, "test.vue");
//!
//! if result.has_errors() {
//! // Format and display errors
//! let output = format_results(&[result], &[(filename.to_string(), source.to_string())], OutputFormat::Text);
//! println!("{}", output);
//! }
//! ```
//!
//! ## Rules
//!
//! Currently implemented rules (eslint-plugin-vue compatible):
//!
//! ### Essential Rules
//! - `vue/require-v-for-key` - Require `v-bind:key` with `v-for` directives
//! - `vue/valid-v-for` - Enforce valid `v-for` directives
//! - `vue/valid-v-if` - Enforce valid `v-if` directives
//! - `vue/valid-v-else` - Enforce valid `v-else` directives
//! - `vue/valid-v-bind` - Enforce valid `v-bind` directives
//! - `vue/valid-v-on` - Enforce valid `v-on` directives
//! - `vue/valid-v-model` - Enforce valid `v-model` directives
//! - `vue/valid-v-show` - Enforce valid `v-show` directives
//! - `vue/no-use-v-if-with-v-for` - Disallow using `v-if` on the same element as `v-for`
//! - `vue/no-unused-vars` - Disallow unused variable definitions in `v-for` directives
//! - `vue/no-duplicate-attributes` - Disallow duplicate attributes
//! - `vue/no-template-key` - Disallow key attribute on `<template>`
//! - `vue/no-textarea-mustache` - Disallow mustache interpolation in `<textarea>`
//! - `vue/no-dupe-v-else-if` - Disallow duplicate conditions in v-if chains
//! - `vue/no-reserved-component-names` - Disallow reserved component names
//!
//! ### Strongly Recommended Rules
//! - `vue/no-template-shadow` - Disallow variable shadowing in v-for
//! - `vue/no-multi-spaces` - Disallow multiple consecutive spaces
//! - `vue/v-bind-style` - Enforce v-bind directive style (shorthand or longform)
//! - `vue/v-on-style` - Enforce v-on directive style (shorthand or longform)
//!
//! ### Vapor Migration Rules (based on Vue 3.6.0-beta.1)
//!
//! Template rules:
//! - `vapor/no-vue-lifecycle-events` - Disallow @vue:xxx per-element lifecycle events
//! - `vapor/no-suspense` - Warn about Suspense in Vapor-only apps
//! - `vapor/prefer-static-class` - Prefer static class over dynamic binding
//! - `vapor/no-inline-template` - Disallow deprecated inline-template
//!
//! Script rules (enabled by opinionated / nuxt presets, or opt-in manually):
//! - `script/no-options-api` - Disallow Options API patterns (Vapor is Composition-only)
//! - `script/no-get-current-instance` - Disallow getCurrentInstance() (returns null in Vapor)
//! - `script/no-next-tick` - Disallow nextTick() scheduling in Vapor-oriented code
//!
//! ### Musea Rules (for *.art.vue files)
//! - `musea/require-title` - Require title attribute in `<art>` block
//! - `musea/require-component` - Require component attribute in `<art>` block
//! - `musea/valid-variant` - Require name attribute in `<variant>` blocks
//! - `musea/no-empty-variant` - Disallow empty variant blocks
//! - `musea/unique-variant-names` - Require unique variant names
//! - `musea/prefer-design-tokens` - Prefer design token CSS variables over hardcoded primitive values
//!
//! ### Script Rules (manual opt-in, default off unless a built-in preset enables them)
//! - `script/prefer-import-from-vue` - Prefer importing from 'vue' instead of internal packages
//! - `script/no-internal-imports` - Disallow importing from Vue internal modules
pub use LintContext;
pub use ;
pub use ;
pub use ;
pub use ;
pub use LintPreset;
pub use ;
pub use ;
pub use Locale;
/// Lint a Vue template source with default rules
///
/// This is a convenience function for simple use cases.
/// For more control, use `Linter::new()` directly.