noIrregularWhitespace
此内容尚不支持你的语言。
Diagnostic Category: lint/nursery/noIrregularWhitespace
Since: v1.9.0
Sources:
- Same as:
no-irregular-whitespace
Description
Section titled “Description”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 “Examples”Invalid
Section titled “Invalid”letcount;
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.
const count = 1;
const foo = '';
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noIrregularWhitespace": "error" } } }}
Related links
Section titled “Related links”Since: v1.9.9
Sources:
- Same as:
stylelint/no-irregular-whitespace
Description
Section titled “Description”Disallows the use of irregular whitespace characters.
Using irregular whitespace would lead to the failure of selecting the correct target.
Examples
Section titled “Examples”Invalid
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.
.firstClass .secondClass { color: red;}
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noIrregularWhitespace": "error" } } }}