Skip to content

Commit c18a1b4

Browse files
committed
Update docs
1 parent 42831a6 commit c18a1b4

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ The rules with the following star :star: are included in the `plugin:regexp/reco
9191
| [regexp/no-useless-backreference](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-backreference.html) | disallow useless backreferences in regular expressions | |
9292
| [regexp/no-useless-character-class](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-character-class.html) | disallow character class with one character | :wrench: |
9393
| [regexp/no-useless-exactly-quantifier](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-exactly-quantifier.html) | disallow unnecessary exactly quantifier | :star: |
94-
| [regexp/no-useless-range](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-range.html) | disallow unnecessary range of characters by using a hyphen | :wrench: |
9594
| [regexp/no-useless-non-greedy](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-non-greedy.html) | disallow unnecessary quantifier non-greedy (`?`) | :wrench: |
95+
| [regexp/no-useless-range](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-range.html) | disallow unnecessary range of characters by using a hyphen | :wrench: |
9696
| [regexp/no-useless-two-nums-quantifier](https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-useless-two-nums-quantifier.html) | disallow unnecessary `{n,m}` quantifier | :star: |
9797
| [regexp/prefer-d](https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-d.html) | enforce using `\d` | :star::wrench: |
9898
| [regexp/prefer-plus-quantifier](https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-plus-quantifier.html) | enforce using `+` quantifier | :star::wrench: |

docs/rules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ The rules with the following star :star: are included in the `plugin:regexp/reco
2323
| [regexp/no-useless-backreference](./no-useless-backreference.md) | disallow useless backreferences in regular expressions | |
2424
| [regexp/no-useless-character-class](./no-useless-character-class.md) | disallow character class with one character | :wrench: |
2525
| [regexp/no-useless-exactly-quantifier](./no-useless-exactly-quantifier.md) | disallow unnecessary exactly quantifier | :star: |
26-
| [regexp/no-useless-range](./no-useless-range.md) | disallow unnecessary range of characters by using a hyphen | :wrench: |
2726
| [regexp/no-useless-non-greedy](./no-useless-non-greedy.md) | disallow unnecessary quantifier non-greedy (`?`) | :wrench: |
27+
| [regexp/no-useless-range](./no-useless-range.md) | disallow unnecessary range of characters by using a hyphen | :wrench: |
2828
| [regexp/no-useless-two-nums-quantifier](./no-useless-two-nums-quantifier.md) | disallow unnecessary `{n,m}` quantifier | :star: |
2929
| [regexp/prefer-d](./prefer-d.md) | enforce using `\d` | :star::wrench: |
3030
| [regexp/prefer-plus-quantifier](./prefer-plus-quantifier.md) | enforce using `+` quantifier | :star::wrench: |

docs/rules/prefer-regexp-exec.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ sidebarDepth: 0
44
title: "regexp/prefer-regexp-exec"
55
description: "enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided"
66
---
7-
---
8-
pageClass: "rule-details"
9-
sidebarDepth: 0
10-
title: "regexp/prefer-regexp-exec"
11-
description: "enforce that `RegExp# regexp/prefer-regexp-exec
12-
13-
> enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided
14-
15-
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
16-
177
# regexp/prefer-regexp-exec
188

199
> enforce that `RegExp#exec` is used instead of `String#match` if no global flag is provided

lib/utils/rules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import noOctal from "../rules/no-octal"
1111
import noUselessBackreference from "../rules/no-useless-backreference"
1212
import noUselessCharacterClass from "../rules/no-useless-character-class"
1313
import noUselessExactlyQuantifier from "../rules/no-useless-exactly-quantifier"
14-
import noUselessRange from "../rules/no-useless-range"
1514
import noUselessNonGreedy from "../rules/no-useless-non-greedy"
15+
import noUselessRange from "../rules/no-useless-range"
1616
import noUselessTwoNumsQuantifier from "../rules/no-useless-two-nums-quantifier"
1717
import preferD from "../rules/prefer-d"
1818
import preferPlusQuantifier from "../rules/prefer-plus-quantifier"
@@ -38,8 +38,8 @@ export const rules = [
3838
noUselessBackreference,
3939
noUselessCharacterClass,
4040
noUselessExactlyQuantifier,
41-
noUselessRange,
4241
noUselessNonGreedy,
42+
noUselessRange,
4343
noUselessTwoNumsQuantifier,
4444
preferD,
4545
preferPlusQuantifier,

tools/update-docs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ class DocFile {
107107
notes.push("", "")
108108
}
109109

110-
const headerPattern = /#.+\n+[^\n]*\n+(?:- .+\n+)*\n*/u
110+
const headerPattern = /(?:^|\n)#.+\n+[^\n]*\n+(?:- .+\n+)*\n*/u
111111

112-
const header = `${title}\n\n${notes.join("\n")}`
112+
const header = `\n${title}\n\n${notes.join("\n")}`
113113
if (headerPattern.test(this.content)) {
114114
this.content = this.content.replace(headerPattern, header)
115115
} else {

0 commit comments

Comments
 (0)