E597 docs: Update `no-irregular-whitespace` and fix examples (#17626) · eslint/eslint@392305b · GitHub
[go: up one dir, main page]

Skip to content

Commit 392305b

Browse files
authored
docs: Update no-irregular-whitespace and fix examples (#17626)
Update `no-irregular-whitespace` docs
1 parent 6b8acfb commit 392305b

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

docs/src/_data/further_reading_links.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,5 +740,12 @@
740740
"logo": "https://v8.dev/favicon.ico",
741741
"title": "RegExp v flag with set notation and properties of strings · V8",
742742
"description": "The new RegExp `v` flag enables `unicodeSets` mode, unlocking support for extended character classes, including Unicode properties of strings, set notation, and improved case-insensitive matching."
743+
},
744+
"https://codepoints.net/U+1680": {
745+
"domain": "codepoints.net",
746+
"url": "https://codepoints.net/U+1680",
747+
"logo": "https://codepoints.net/favicon.ico",
748+
"title": "U+1680 OGHAM SPACE MARK:   – Unicode – Codepoints",
749+
"description": " , codepoint U+1680 OGHAM SPACE MARK in Unicode, is located in the block “Ogham”. It belongs to the Ogham script and is a Space Separator."
743750
}
744751
}

docs/src/rules/no-irregular-whitespace.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ rule_type: problem
44
further_reading:
55
- https://es5.github.io/#x7.2
66
- https://web.archive.org/web/20200414142829/http://timelessrepo.com/json-isnt-a-javascript-subset
7+
- https://codepoints.net/U+1680
78
---
89

910

@@ -16,11 +17,17 @@ A simple fix for this problem could be to rewrite the offending line from scratc
1617

1718
Known issues these spaces cause:
1819

20+
* Ogham Space Mark
21+
* Is a valid token separator, but is rendered as a visible glyph in most typefaces, which may be misleading in source code.
22+
* Mongolian Vowel Separator
23+
* Is no longer considered a space separator since Unicode 6.3. It will result in a syntax error in current parsers when used in place of a regular token separator.
24+
* Line Separator and Paragraph Separator
25+
* These have always been valid whitespace characters and line terminators, but were considered illegal in string literals prior to ECMAScript 2019.
1926
* Zero Width Space
20-
* Is NOT considered a separator for tokens and is often parsed as an `Unexpected token ILLEGAL`
21-
* Is NOT shown in modern browsers making code repository software expected to resolve the visualization
22-
* Line Separator
23-
* Is NOT a valid character within JSON which would cause parse errors
27+
* Is NOT considered a separator for tokens and is often parsed as an `Unexpected token ILLEGAL`.
28+
* Is NOT shown in modern browsers making code repository software expected to resolve the visualization.
29+
30+
In JSON, none of the characters listed as irregular whitespace by this rule may appear outside of a string.
2431

2532
## Rule Details
2633

@@ -86,7 +93,7 @@ var thing = function /*<NBSP>*/(){
8693
return 'test';
8794
}
8895

89-
var thing = function/*<MVS>*/(){
96+
var thing = function/*<Ogham Space Mark>*/(){
9097
return 'test';
9198
}
9299

@@ -204,7 +211,7 @@ Examples of additional **correct** code for this rule with the `{ "skipJSXText":
204211
/*eslint-env es6*/
205212

206213
function Thing() {
207-
return <div>text in<NBSP>JSX</div>;
214+
return <div>text inJSX</div>; // <NBSP> before `JSX`
208215
}
209216
```
210217

0 commit comments

Comments
 (0)
0