mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(linter): make disable directives work with plugin rule names
This commit is contained in:
parent
edb3f8b634
commit
ad51157ea9
1 changed files with 5 additions and 1 deletions
|
|
@ -17,7 +17,11 @@ pub struct DisableDirectives<'a> {
|
|||
impl<'a> DisableDirectives<'a> {
|
||||
pub fn contains(&self, rule_name: &'static str, start: u32) -> bool {
|
||||
self.intervals.find(start, start + 1).any(|interval| {
|
||||
interval.val == DisabledRule::All || interval.val == DisabledRule::Single(rule_name)
|
||||
interval.val == DisabledRule::All
|
||||
// Our rule name currently does not contain the prefix.
|
||||
// For example, this will match `@typescript-eslint/no-var-requires` given
|
||||
// our rule_name is `no-var-requires`.
|
||||
|| matches!(interval.val, DisabledRule::Single(name) if name.contains(rule_name))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue