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

pub struct NoIrregularWhitespace {
    pub skip_strings: bool,
    pub skip_comments: bool,
    pub skip_regex: bool,
    pub skip_templates: bool,
}

Disallow weird/irregular whitespace.

ECMAScript allows a wide selection of unicode whitespace, they are however known to cause issues with various parsers, therefore they should never be used.

A lot of the whitespace is invisible, therefore is hard to detect, it may have been inserted by accident.

Whitespace such as line separator causes issues since line separators are not valid JSON which may cause many issues.

This rule disallows the following whitespace:

\u000B - Line Tabulation (\v) - <VT>
\u000C - Form Feed (\f) - <FF>
\u00A0 - No-Break Space - <NBSP>
\u0085 - Next Line
\u1680 - Ogham Space Mark
\u180E - Mongolian Vowel Separator - <MVS>
\ufeff - Zero Width No-Break Space - <BOM>
\u2000 - En Quad
\u2001 - Em Quad
\u2002 - En Space - <ENSP>
\u2003 - Em Space - <EMSP>
\u2004 - Tree-Per-Em
\u2005 - Four-Per-Em
\u2006 - Six-Per-Em
\u2007 - Figure Space
\u2008 - Punctuation Space - <PUNCSP>
\u2009 - Thin Space
\u200A - Hair Space
\u200B - Zero Width Space - <ZWSP>
\u2028 - Line Separator
\u2029 - Paragraph Separator
\u202F - Narrow No-Break Space
\u205f - Medium Mathematical Space
\u3000 - Ideographic Space

Fields

skip_strings: bool

Whether to allow any whitespace in string literals (true by default)

skip_comments: bool

Whether to allow any whitespace in comments (false by default)

skip_regex: bool

Whether to allow any whitespace in regular expressions (false by default)

skip_templates: bool

Whether to allow any whitespace in template literals (false by default)

Implementations

impl NoIrregularWhitespace[src]

pub fn new() -> Self[src]

Trait Implementations

impl Clone for NoIrregularWhitespace[src]

impl CstRule for NoIrregularWhitespace[src]

impl Debug for NoIrregularWhitespace[src]

impl Default for NoIrregularWhitespace[src]

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

impl Rule for NoIrregularWhitespace[src]

impl Serialize for NoIrregularWhitespace[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.