pub struct BannedImportRule { /* private fields */ }Expand description
Scans source files for import/require statements referencing banned packages.
Detects patterns like:
import ... from 'pkg'import 'pkg'require('pkg')- Subpath imports like
import ... from 'lodash/debounce'
Uses word-boundary matching to avoid false positives (e.g., moment won’t
match momentum).
Implementations§
Source§impl BannedImportRule
impl BannedImportRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Debug for BannedImportRule
impl Debug for BannedImportRule
Source§impl Rule for BannedImportRule
impl Rule for BannedImportRule
Auto Trait Implementations§
impl Freeze for BannedImportRule
impl RefUnwindSafe for BannedImportRule
impl Send for BannedImportRule
impl Sync for BannedImportRule
impl Unpin for BannedImportRule
impl UnsafeUnpin for BannedImportRule
impl UnwindSafe for BannedImportRule
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