Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/rules/sort-character-class-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,17 @@
) {
raw = `\\${raw}`
}
} else if (raw.startsWith("^")) {
} else if (raw[0] === "^") {

Check failure on line 299 in lib/rules/sort-character-class-elements.ts

View workflow job for this annotation

GitHub Actions / lint

Use 'String#startsWith' method instead
const parent = target.parent as CharacterClass
const elements: (
| UnicodeSetsCharacterClassElement
| ClassRangesCharacterClassElement
)[] = parent.elements
if (elements.indexOf(target) === 0) {
if (elements[0] === target) {
raw = `\\${raw}`
}
}
if (target.raw.startsWith("-")) {
if (target.raw[0] === "-") {

Check failure on line 309 in lib/rules/sort-character-class-elements.ts

View workflow job for this annotation

GitHub Actions / lint

Use 'String#startsWith' method instead
if (node.type === "Character" || node.type === "CharacterSet") {
raw = `${raw}\\`
}
Expand Down
Loading