src/content/docs/linter/rules/no-irregular-whitespace.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> ## Summary - Rule available since: `v1.9.0` - Diagnostic Category: [`lint/suspicious/noIrregularWhitespace`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**warning**](/reference/diagnostics#warning). - Sources: - Same as [`no-irregular-whitespace`](https://eslint.org/docs/latest/rules/no-irregular-whitespace){
"linter": {
"rules": {
"suspicious": {
"noIrregularWhitespace": "error"
}
}
}
}
Disallows the use of irregular whitespace characters.
Invalid or irregular whitespace causes issues with various parsers and also makes code harder to debug.
letcount;
let foo;
const count = 1;
const foo = '';
{
"linter": {
"rules": {
"suspicious": {
"noIrregularWhitespace": "error"
}
}
}
}
Disallows the use of irregular whitespace characters.
Using irregular whitespace would lead to the failure of selecting the correct target.
.firstClass.secondClass {
color: red;
}
.firstClass .secondClass {
color: red;
}