Skip to content

Commit 15ff713

Browse files
bteaota-meshi
andauthored
refctor: replace indexOf with strict equality (#864)
* refctor: replace startsWith with strict equality * chore: revert * chore: revert * Create serious-plants-decide.md --------- Co-authored-by: Yosuke Ota <[email protected]>
1 parent 98f9189 commit 15ff713

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/serious-plants-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-regexp": minor
3+
---
4+
5+
refctor: replace `indexOf()` with strict equality

lib/rules/sort-character-class-elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function escapeRaw(node: CharacterClassElement, target: CharacterClassElement) {
302302
| UnicodeSetsCharacterClassElement
303303
| ClassRangesCharacterClassElement
304304
)[] = parent.elements
305-
if (elements.indexOf(target) === 0) {
305+
if (elements[0] === target) {
306306
raw = `\\${raw}`
307307
}
308308
}

0 commit comments

Comments
 (0)