pub struct BannedPatternRule { /* private fields */ }Expand description
Scans files line-by-line for a literal string or regex match.
Useful for banning code patterns like style={{, console.log(, // @ts-ignore, etc.
When regex is true in the config, the pattern is treated as a regular expression.
Implementations§
Source§impl BannedPatternRule
impl BannedPatternRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Debug for BannedPatternRule
impl Debug for BannedPatternRule
Source§impl Rule for BannedPatternRule
impl Rule for BannedPatternRule
Auto Trait Implementations§
impl Freeze for BannedPatternRule
impl RefUnwindSafe for BannedPatternRule
impl Send for BannedPatternRule
impl Sync for BannedPatternRule
impl Unpin for BannedPatternRule
impl UnsafeUnpin for BannedPatternRule
impl UnwindSafe for BannedPatternRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more