noIrregularWhitespace
此内容尚不支持你的语言。
Diagnostic Category: lint/nursery/noIrregularWhitespace
Since: v1.9.0
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 Invalidcode-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.
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 ValidRelated links
Section titled Related linksSince: v1.9.0
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 Invalidcode-block.css:1:12 lint/nursery/noIrregularWhitespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Irregular whitespace found.
> 1 │ .firstClass␋.secondClass {
│ ^
2 │ color: red;
3 │ }
ℹ Replace the irregular whitespace with normal whitespaces.
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.