Skip to content

Commit

Permalink
perf: improve sort-imports rule performance
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jun 2, 2023
1 parent b4b0c0c commit 2989539
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rules/sort-imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ export default createEslintRule<Options, MESSAGE_ID>({
'.',
].includes(value)

let isParent = (value: string) => /^\.\.$|^\.\.[/\\]/.test(value)
let isParent = (value: string) => value.indexOf('..') === 0

let isSibling = (value: string) => /^\.[/\\]/.test(value)
let isSibling = (value: string) => value.indexOf('./') === 0

let defineGroup = (nodeGroup: Group) => {
if (!group && options.groups.flat().includes(nodeGroup)) {
Expand Down

0 comments on commit 2989539

Please sign in to comment.