[][src]Struct rslint_core::groups::errors::NoUnsafeNegation

pub struct NoUnsafeNegation {}

Deny the use of ! on the left hand side of an instanceof or in expression where it is ambiguous.

JavaScript precedence is higher for logical not than it is for in or instanceof. Oftentimes you see expressions such as !foo instanceof bar, which most of the times produces unexpected behavior. precedence will group the expressions like (!foo) instanceof bar. Most of the times the developer expects the expression to check if foo is not an instance of bar however.

Incorrect Code Examples

if (!foo instanceof String) {

}
if (!bar in {}) {

}

Implementations

impl NoUnsafeNegation[src]

pub fn new() -> Self[src]

Trait Implementations

impl Clone for NoUnsafeNegation[src]

impl CstRule for NoUnsafeNegation[src]

impl Debug for NoUnsafeNegation[src]

impl Default for NoUnsafeNegation[src]

impl<'de> Deserialize<'de> for NoUnsafeNegation[src]

impl Rule for NoUnsafeNegation[src]

impl Serialize for NoUnsafeNegation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.