@@ -32,7 +32,7 @@ pub struct ContextSubHost<'a> {
32
32
pub ( super ) module_record : Arc < ModuleRecord > ,
33
33
/// Information about specific rules that should be disabled or enabled, via comment directives like
34
34
/// `eslint-disable` or `eslint-disable-next-line`.
35
- pub ( super ) disable_directives : DisableDirectives < ' a > ,
35
+ pub ( super ) disable_directives : DisableDirectives ,
36
36
// Specific framework options, for example, whether the context is inside `<script setup>` in Vue files.
37
37
pub ( super ) framework_options : FrameworkOptions ,
38
38
/// The source text offset of the sub host
@@ -93,7 +93,7 @@ impl<'a> ContextSubHost<'a> {
93
93
}
94
94
95
95
/// Shared reference to the [`DisableDirectives`]
96
- pub fn disable_directives ( & self ) -> & DisableDirectives < ' a > {
96
+ pub fn disable_directives ( & self ) -> & DisableDirectives {
97
97
& self . disable_directives
98
98
}
99
99
}
@@ -202,7 +202,7 @@ impl<'a> ContextHost<'a> {
202
202
}
203
203
204
204
/// Shared reference to the [`DisableDirectives`] of the current script block.
205
- pub fn disable_directives ( & self ) -> & DisableDirectives < ' a > {
205
+ pub fn disable_directives ( & self ) -> & DisableDirectives {
206
206
& self . current_sub_host ( ) . disable_directives
207
207
}
208
208
@@ -309,7 +309,7 @@ impl<'a> ContextHost<'a> {
309
309
"Unused eslint-enable directive (no matching eslint-disable directives were found)." ;
310
310
for ( rule_name, enable_comment_span) in self . disable_directives ( ) . unused_enable_comments ( ) {
311
311
unused_directive_diagnostics. push ( (
312
- rule_name. map_or ( Cow :: Borrowed ( message_for_enable) , |name| {
312
+ rule_name. as_ref ( ) . map_or ( Cow :: Borrowed ( message_for_enable) , |name| {
313
313
Cow :: Owned ( format ! (
314
314
"Unused eslint-enable directive (no matching eslint-disable directives were found for {name})."
315
315
) )
0 commit comments