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

pub struct NoEmpty {
    pub disallow_empty_functions: bool,
    pub allow_empty_catch: bool,
}

Disallow empty block statements.

Block statements with nothing in them are very common when refactoring, however they can get confusing really quickly. This rule reports empty block statements and empty switch case blocks if they do not have a comment.

Invalid Code Examples

{}
if (foo) {

}

Correct Code Examples

if (foo) {
    /* todo */
}

Fields

disallow_empty_functions: bool

Whether to disallow empty block statements in function declarations, arrow functions, getters, setters, and methods.

allow_empty_catch: bool

Whether to allow empty catch clauses without a comment.

Implementations

impl NoEmpty[src]

pub fn new() -> Self[src]

Trait Implementations

impl Clone for NoEmpty[src]

impl CstRule for NoEmpty[src]

impl Debug for NoEmpty[src]

impl Default for NoEmpty[src]

impl<'de> Deserialize<'de> for NoEmpty where
    NoEmpty: Default
[src]

impl Rule for NoEmpty[src]

impl Serialize for NoEmpty[src]

Auto Trait Implementations

impl RefUnwindSafe for NoEmpty

impl Send for NoEmpty

impl Sync for NoEmpty

impl Unpin for NoEmpty

impl UnwindSafe for NoEmpty

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.