noIrregularWhitespace
Diagnostic Category: lint/nursery/noIrregularWhitespace
Since: vnext
Sources:
- Same as:
no-irregular-whitespace
Disallows the use of irregular whitespace characters.
Invalid or irregular whitespace causes issues with various parsers and also makes code harder to debug.
Examples
Section titled ExamplesInvalid
Section titled Invalidletcount;
code-block.js:1:4 lint/nursery/noIrregularWhitespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Irregular whitespaces found.
> 1 │ let␋count;
│ ^
2 │
ℹ Irregular whitespaces can cause issues to other parsers, and make the code harder to debug.
ℹ Replace the irregular whitespaces with normal whitespaces or tabs.
let foo;
code-block.js:1:4 lint/nursery/noIrregularWhitespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Irregular whitespaces found.
> 1 │ let␠foo;
│ ^
2 │
ℹ Irregular whitespaces can cause issues to other parsers, and make the code harder to debug.
ℹ Replace the irregular whitespaces with normal whitespaces or tabs.
Valid
Section titled Validconst count = 1;
const foo = '';
Related links
Section titled Related linksSince: vnext
Sources:
- Same as:
stylelint/no-irregular-whitespace
Disallows the use of irregular whitespace characters.
Using irregular whitespace would lead to the failure of selecting the correct target.
Examples
Section titled ExamplesInvalid
Section titled Invalid.firstClass.secondClass { color: red;}
code-block.css:1:12 lint/nursery/noIrregularWhitespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Irregular whitespace found.
> 1 │ .firstClass␋.secondClass {
│ ^
2 │ color: red;
3 │ }
ℹ Replace the irregular whitespace with normal whitespaces.
.firstClass .secondClass { color:red;}
code-block.css:2:9 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The CSS standard only allows tabs, whitespace, carriage return and line feed whitespace.
1 │ .firstClass .secondClass {
> 2 │ color:␋red;
│ ^
3 │ }
4 │
ℹ Use a regular whitespace character instead.
Valid
Section titled Valid.firstClass .secondClass { color: red;}