eslint-plugin-perfectionist 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,57 +3,57 @@ import { ESLintUtils as ue, ASTUtils as W } from "@typescript-eslint/utils";
3
3
  import { minimatch as D } from "minimatch";
4
4
  import ce from "natural-compare-lite";
5
5
  import { builtinModules as de } from "node:module";
6
- let j = ue.RuleCreator(
6
+ let I = ue.RuleCreator(
7
7
  (r) => `https://eslint-plugin-perfectionist.azat.io/rules/${r}`
8
8
  ), x = (r, l) => {
9
9
  for (let s = 0, t = r.length; s < t; s++) {
10
- let u = r[s];
11
- if (l.group === u || Array.isArray(u) && typeof l.group == "string" && u.includes(l.group))
10
+ let c = r[s];
11
+ if (l.group === c || Array.isArray(c) && typeof l.group == "string" && c.includes(l.group))
12
12
  return s;
13
13
  }
14
14
  return r.length;
15
- }, v = (r) => {
15
+ }, j = (r) => {
16
16
  let [l, s] = r;
17
17
  return s - l;
18
18
  }, k = (r) => r > 0;
19
19
  var p = /* @__PURE__ */ ((r) => (r.alphabetical = "alphabetical", r["line-length"] = "line-length", r.natural = "natural", r))(p || {}), d = /* @__PURE__ */ ((r) => (r.desc = "desc", r.asc = "asc", r))(d || {});
20
20
  let R = (r) => {
21
- let l, s = (u) => {
22
- !l && r.flat().includes(u) && (l = u);
21
+ let l, s = (c) => {
22
+ !l && r.flat().includes(c) && (l = c);
23
23
  };
24
24
  return {
25
25
  getGroup: () => l ?? "unknown",
26
- setCustomGroups: (u, n) => {
27
- if (u)
28
- for (let [e, a] of Object.entries(u))
29
- Array.isArray(a) && a.some(
30
- (i) => D(n, i, {
26
+ setCustomGroups: (c, a) => {
27
+ if (c)
28
+ for (let [e, n] of Object.entries(c))
29
+ Array.isArray(n) && n.some(
30
+ (i) => D(a, i, {
31
31
  nocomment: !0
32
32
  })
33
- ) && s(e), typeof a == "string" && D(n, a, {
33
+ ) && s(e), typeof n == "string" && D(a, n, {
34
34
  nocomment: !0
35
35
  }) && s(e);
36
36
  },
37
37
  defineGroup: s
38
38
  };
39
39
  }, O = (r, l, s) => {
40
- var e, a;
40
+ var e, n;
41
41
  if ((e = l.dependencies) != null && e.includes(r.name))
42
42
  return -1;
43
- if ((a = r.dependencies) != null && a.includes(l.name))
43
+ if ((n = r.dependencies) != null && n.includes(l.name))
44
44
  return 1;
45
- let t = s.order === "asc" ? 1 : -1, u, n = (i) => s["ignore-case"] ? i.toLowerCase() : i;
46
- return s.type === p.alphabetical ? u = (i, o) => n(i.name).localeCompare(n(o.name)) : s.type === p.natural ? u = (i, o) => ce(n(i.name), n(o.name)) : u = (i, o) => {
47
- let c = i.size, y = o.size, h = s["max-line-length"];
45
+ let t = s.order === "asc" ? 1 : -1, c, a = (i) => s["ignore-case"] ? i.toLowerCase() : i;
46
+ return s.type === p.alphabetical ? c = (i, o) => a(i.name).localeCompare(a(o.name)) : s.type === p.natural ? c = (i, o) => ce(a(i.name), a(o.name)) : c = (i, o) => {
47
+ let u = i.size, y = o.size, h = s["max-line-length"];
48
48
  if (h) {
49
49
  let f = (g, m) => g > h && m.hasMultipleImportDeclarations;
50
- f(c, i) && (c = i.name.length + 10), f(y, o) && (y = o.name.length + 10);
50
+ f(u, i) && (u = i.name.length + 10), f(y, o) && (y = o.name.length + 10);
51
51
  }
52
- return c - y;
53
- }, t * u(r, l);
52
+ return u - y;
53
+ }, t * c(r, l);
54
54
  }, A = (r, l) => [...r].sort((s, t) => O(s, t, l)), fe = (r, l) => {
55
55
  let s = l.getTokenAfter(r, {
56
- filter: ({ value: t, type: u }) => !(u === "Punctuator" && [",", ";"].includes(t)),
56
+ filter: ({ value: t, type: c }) => !(c === "Punctuator" && [",", ";"].includes(t)),
57
57
  includeComments: !0
58
58
  });
59
59
  return ((s == null ? void 0 : s.type) === "Block" || (s == null ? void 0 : s.type) === "Line") && r.loc.end.line === s.loc.end.line ? s : null;
@@ -65,14 +65,14 @@ let R = (r) => {
65
65
  nocomment: !0
66
66
  }) || r === !0, J = (r, l) => {
67
67
  let [s, t] = l.getTokensBefore(r, {
68
- filter: ({ value: u, type: n }) => !(n === "Punctuator" && [",", ";"].includes(u)),
68
+ filter: ({ value: c, type: a }) => !(a === "Punctuator" && [",", ";"].includes(c)),
69
69
  includeComments: !0,
70
70
  count: 2
71
71
  });
72
72
  return ((t == null ? void 0 : t.type) === "Block" || (t == null ? void 0 : t.type) === "Line") && r.loc.start.line - t.loc.end.line <= 1 && (s == null ? void 0 : s.loc.end.line) !== t.loc.start.line ? t : null;
73
73
  }, M = (r, l, s) => {
74
- var a;
75
- let t = r.range.at(0), u = r.range.at(1), n = l.text.slice(t, u);
74
+ var n;
75
+ let t = r.range.at(0), c = r.range.at(1), a = l.text.slice(t, c);
76
76
  if (W.isParenthesized(r, l)) {
77
77
  let i = l.getTokenBefore(
78
78
  r,
@@ -81,30 +81,30 @@ let R = (r) => {
81
81
  r,
82
82
  W.isClosingParenToken
83
83
  );
84
- t = i.range.at(0), u = o.range.at(1);
84
+ t = i.range.at(0), c = o.range.at(1);
85
85
  }
86
86
  let e = J(r, l);
87
- if (n.endsWith(";") || n.endsWith(",")) {
87
+ if (a.endsWith(";") || a.endsWith(",")) {
88
88
  let i = l.getTokensAfter(r, {
89
89
  includeComments: !0,
90
90
  count: 2
91
91
  });
92
- r.loc.start.line === ((a = i.at(1)) == null ? void 0 : a.loc.start.line) && (u -= 1);
92
+ r.loc.start.line === ((n = i.at(1)) == null ? void 0 : n.loc.start.line) && (c -= 1);
93
93
  }
94
94
  return e && !pe(
95
95
  (s == null ? void 0 : s.partitionComment) ?? !1,
96
96
  e.value
97
- ) && (t = e.range.at(0)), [t, u];
98
- }, T = (r, l, s, t, u) => {
99
- var a, i;
100
- let n = [], e = ((a = l.at(0)) == null ? void 0 : a.node.loc.start.line) === ((i = l.at(-1)) == null ? void 0 : i.node.loc.end.line);
101
- for (let o = 0, c = l.length; o < c; o++) {
97
+ ) && (t = e.range.at(0)), [t, c];
98
+ }, T = (r, l, s, t, c) => {
99
+ var n, i;
100
+ let a = [], e = ((n = l.at(0)) == null ? void 0 : n.node.loc.start.line) === ((i = l.at(-1)) == null ? void 0 : i.node.loc.end.line);
101
+ for (let o = 0, u = l.length; o < u; o++) {
102
102
  let { node: y } = l.at(o);
103
- n.push(
103
+ a.push(
104
104
  r.replaceTextRange(
105
- M(y, t, u),
105
+ M(y, t, c),
106
106
  t.text.slice(
107
- ...M(s.at(o).node, t, u)
107
+ ...M(s.at(o).node, t, c)
108
108
  )
109
109
  )
110
110
  );
@@ -114,9 +114,9 @@ let R = (r) => {
114
114
  t.getTokenBefore(h).range.at(1),
115
115
  h.range.at(1)
116
116
  ];
117
- n.push(r.replaceTextRange(g, ""));
117
+ a.push(r.replaceTextRange(g, ""));
118
118
  let m = t.getTokenAfter(y);
119
- n.push(
119
+ a.push(
120
120
  r.insertTextAfter(
121
121
  (m == null ? void 0 : m.loc.end.line) === y.loc.end.line ? m : y,
122
122
  t.text.slice(...g)
@@ -124,15 +124,15 @@ let R = (r) => {
124
124
  );
125
125
  }
126
126
  }
127
- return n;
127
+ return a;
128
128
  }, C = (r = {}, l) => Object.assign(l, r), P = (r, l) => {
129
129
  if (r.length > 1)
130
130
  for (let s = 1; s < r.length; s++) {
131
- let t = r.at(s - 1), u = r.at(s);
132
- t && u && l(t, u, s - 1);
131
+ let t = r.at(s - 1), c = r.at(s);
132
+ t && c && l(t, c, s - 1);
133
133
  }
134
134
  };
135
- const X = "sort-svelte-attributes", ge = j({
135
+ const X = "sort-svelte-attributes", ge = I({
136
136
  name: X,
137
137
  meta: {
138
138
  type: "suggestion",
@@ -191,35 +191,35 @@ const X = "sort-svelte-attributes", ge = j({
191
191
  "ignore-case": !1,
192
192
  "custom-groups": {},
193
193
  groups: []
194
- }), t = r.getSourceCode(), u = l.attributes.reduce(
195
- (n, e) => {
194
+ }), t = r.getSourceCode(), c = l.attributes.reduce(
195
+ (a, e) => {
196
196
  if (e.type === "SvelteSpreadAttribute")
197
- return n.push([]), n;
198
- let a, { getGroup: i, defineGroup: o, setCustomGroups: c } = R(
197
+ return a.push([]), a;
198
+ let n, { getGroup: i, defineGroup: o, setCustomGroups: u } = R(
199
199
  s.groups
200
200
  );
201
- return e.key.type === "SvelteSpecialDirectiveKey" ? a = t.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: a } = e.key : a = t.text.slice(...e.key.range), c(s["custom-groups"], a), e.type === "SvelteShorthandAttribute" && (o("svelte-shorthand"), o("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline"), n.at(-1).push({
202
- size: v(e.range),
201
+ return e.key.type === "SvelteSpecialDirectiveKey" ? n = t.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: n } = e.key : n = t.text.slice(...e.key.range), u(s["custom-groups"], n), e.type === "SvelteShorthandAttribute" && (o("svelte-shorthand"), o("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline"), a.at(-1).push({
202
+ size: j(e.range),
203
203
  node: e,
204
204
  group: i(),
205
- name: a
206
- }), n;
205
+ name: n
206
+ }), a;
207
207
  },
208
208
  [[]]
209
209
  );
210
- for (let n of u)
211
- P(n, (e, a) => {
212
- let i = x(s.groups, e), o = x(s.groups, a);
213
- (i > o || i === o && k(O(e, a, s))) && r.report({
210
+ for (let a of c)
211
+ P(a, (e, n) => {
212
+ let i = x(s.groups, e), o = x(s.groups, n);
213
+ (i > o || i === o && k(O(e, n, s))) && r.report({
214
214
  messageId: "unexpectedSvelteAttributesOrder",
215
215
  data: {
216
216
  left: e.name,
217
- right: a.name
217
+ right: n.name
218
218
  },
219
- node: a.node,
220
- fix: (c) => {
219
+ node: n.node,
220
+ fix: (u) => {
221
221
  let y = {};
222
- for (let f of n) {
222
+ for (let f of a) {
223
223
  let g = x(s.groups, f);
224
224
  g in y ? y[g] = A(
225
225
  [...y[g], f],
@@ -229,14 +229,14 @@ const X = "sort-svelte-attributes", ge = j({
229
229
  let h = [];
230
230
  for (let f of Object.keys(y).sort())
231
231
  h.push(...A(y[f], s));
232
- return T(c, n, h, t);
232
+ return T(u, a, h, t);
233
233
  }
234
234
  });
235
235
  });
236
236
  }
237
237
  }
238
238
  }
239
- }), q = "sort-astro-attributes", ye = j({
239
+ }), q = "sort-astro-attributes", ye = I({
240
240
  name: q,
241
241
  meta: {
242
242
  type: "suggestion",
@@ -297,29 +297,29 @@ const X = "sort-svelte-attributes", ge = j({
297
297
  "ignore-case": !1,
298
298
  "custom-groups": {},
299
299
  groups: []
300
- }), u = r.getSourceCode(), n = s.reduce(
301
- (e, a) => {
302
- if (a.type === "JSXSpreadAttribute")
300
+ }), c = r.getSourceCode(), a = s.reduce(
301
+ (e, n) => {
302
+ if (n.type === "JSXSpreadAttribute")
303
303
  return e.push([]), e;
304
- let i = typeof a.name.name == "string" ? a.name.name : u.text.slice(...a.name.range), { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
304
+ let i = typeof n.name.name == "string" ? n.name.name : c.text.slice(...n.name.range), { getGroup: o, defineGroup: u, setCustomGroups: y } = R(
305
305
  t.groups
306
306
  );
307
- return y(t["custom-groups"], i), a.type === "AstroShorthandAttribute" && (c("astro-shorthand"), c("shorthand")), a.value === null && c("shorthand"), a.loc.start.line !== a.loc.end.line && c("multiline"), e.at(-1).push({
308
- size: v(a.range),
309
- node: a,
307
+ return y(t["custom-groups"], i), n.type === "AstroShorthandAttribute" && (u("astro-shorthand"), u("shorthand")), n.value === null && u("shorthand"), n.loc.start.line !== n.loc.end.line && u("multiline"), e.at(-1).push({
308
+ size: j(n.range),
309
+ node: n,
310
310
  group: o(),
311
311
  name: i
312
312
  }), e;
313
313
  },
314
314
  [[]]
315
315
  );
316
- for (let e of n)
317
- P(e, (a, i) => {
318
- let o = x(t.groups, a), c = x(t.groups, i);
319
- (o > c || o === c && k(O(a, i, t))) && r.report({
316
+ for (let e of a)
317
+ P(e, (n, i) => {
318
+ let o = x(t.groups, n), u = x(t.groups, i);
319
+ (o > u || o === u && k(O(n, i, t))) && r.report({
320
320
  messageId: "unexpectedAstroAttributesOrder",
321
321
  data: {
322
- left: a.name,
322
+ left: n.name,
323
323
  right: i.name
324
324
  },
325
325
  node: i.node,
@@ -335,7 +335,7 @@ const X = "sort-svelte-attributes", ge = j({
335
335
  let f = [];
336
336
  for (let g of Object.keys(h).sort())
337
337
  f.push(...A(h[g], t));
338
- return T(y, e, f, u);
338
+ return T(y, e, f, c);
339
339
  }
340
340
  });
341
341
  });
@@ -343,8 +343,8 @@ const X = "sort-svelte-attributes", ge = j({
343
343
  }
344
344
  }
345
345
  });
346
- let I = (r) => r.replaceAll(/\s\s+/g, " ").trim();
347
- const K = "sort-array-includes", me = j({
346
+ let v = (r) => r.replaceAll(/\s\s+/g, " ").trim();
347
+ const K = "sort-array-includes", me = I({
348
348
  name: K,
349
349
  meta: {
350
350
  type: "suggestion",
@@ -402,30 +402,30 @@ const K = "sort-array-includes", me = j({
402
402
  order: d.asc,
403
403
  "ignore-case": !1,
404
404
  "spread-last": !1
405
- }), u = r.getSourceCode(), n = s.reduce(
406
- (e, a) => (a !== null && e.at(0).push({
407
- name: a.type === "Literal" ? `${a.value}` : u.text.slice(...a.range),
408
- size: v(a.range),
409
- type: a.type,
410
- node: a
405
+ }), c = r.getSourceCode(), a = s.reduce(
406
+ (e, n) => (n !== null && e.at(0).push({
407
+ name: n.type === "Literal" ? `${n.value}` : c.text.slice(...n.range),
408
+ size: j(n.range),
409
+ type: n.type,
410
+ node: n
411
411
  }), e),
412
412
  [[], []]
413
413
  ).flat();
414
- P(n, (e, a) => {
414
+ P(a, (e, n) => {
415
415
  let i;
416
- t["spread-last"] && e.node.type === "Literal" && a.node.type === "SpreadElement" ? i = !1 : t["spread-last"] && e.node.type === "SpreadElement" && a.node.type === "Literal" ? i = !0 : i = k(O(e, a, t)), i && r.report({
416
+ t["spread-last"] && e.node.type === "Literal" && n.node.type === "SpreadElement" ? i = !1 : t["spread-last"] && e.node.type === "SpreadElement" && n.node.type === "Literal" ? i = !0 : i = k(O(e, n, t)), i && r.report({
417
417
  messageId: "unexpectedArrayIncludesOrder",
418
418
  data: {
419
- left: I(e.name),
420
- right: I(a.name)
419
+ left: v(e.name),
420
+ right: v(n.name)
421
421
  },
422
- node: a.node,
422
+ node: n.node,
423
423
  fix: (o) => {
424
- let c = A(n, t);
424
+ let u = A(a, t);
425
425
  if (t["spread-last"])
426
- for (let y = 0, h = c.length; y < h; y++)
427
- c.at(y).node.type === "SpreadElement" && c.push(c.splice(y, 1).at(0));
428
- return T(o, n, c, u);
426
+ for (let y = 0, h = u.length; y < h; y++)
427
+ u.at(y).node.type === "SpreadElement" && u.push(u.splice(y, 1).at(0));
428
+ return T(o, a, u, c);
429
429
  }
430
430
  });
431
431
  });
@@ -433,7 +433,7 @@ const K = "sort-array-includes", me = j({
433
433
  }
434
434
  }
435
435
  })
436
- }), F = "sort-vue-attributes", he = j({
436
+ }), F = "sort-vue-attributes", he = I({
437
437
  name: F,
438
438
  meta: {
439
439
  type: "suggestion",
@@ -499,29 +499,29 @@ const K = "sort-array-includes", me = j({
499
499
  "ignore-case": !1,
500
500
  "custom-groups": {},
501
501
  groups: []
502
- }), u = r.getSourceCode(), n = s.attributes.reduce(
503
- (e, a) => {
504
- if (a.key.type === "VDirectiveKey" && a.key.name.rawName === "bind")
502
+ }), c = r.getSourceCode(), a = s.attributes.reduce(
503
+ (e, n) => {
504
+ if (n.key.type === "VDirectiveKey" && n.key.name.rawName === "bind")
505
505
  return e.push([]), e;
506
- let i, { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
506
+ let i, { getGroup: o, defineGroup: u, setCustomGroups: y } = R(
507
507
  t.groups
508
508
  );
509
- return typeof a.key.name == "string" && a.key.type !== "VDirectiveKey" ? i = a.key.rawName : i = u.text.slice(...a.key.range), y(t["custom-groups"], i), a.value === null && c("shorthand"), a.loc.start.line !== a.loc.end.line && c("multiline"), e.at(-1).push({
510
- size: v(a.range),
511
- node: a,
509
+ return typeof n.key.name == "string" && n.key.type !== "VDirectiveKey" ? i = n.key.rawName : i = c.text.slice(...n.key.range), y(t["custom-groups"], i), n.value === null && u("shorthand"), n.loc.start.line !== n.loc.end.line && u("multiline"), e.at(-1).push({
510
+ size: j(n.range),
511
+ node: n,
512
512
  group: o(),
513
513
  name: i
514
514
  }), e;
515
515
  },
516
516
  [[]]
517
517
  );
518
- for (let e of n)
519
- P(e, (a, i) => {
520
- let o = x(t.groups, a), c = x(t.groups, i);
521
- (o > c || o === c && k(O(a, i, t))) && r.report({
518
+ for (let e of a)
519
+ P(e, (n, i) => {
520
+ let o = x(t.groups, n), u = x(t.groups, i);
521
+ (o > u || o === u && k(O(n, i, t))) && r.report({
522
522
  messageId: "unexpectedVueAttributesOrder",
523
523
  data: {
524
- left: a.name,
524
+ left: n.name,
525
525
  right: i.name
526
526
  },
527
527
  node: i.node,
@@ -537,7 +537,7 @@ const K = "sort-array-includes", me = j({
537
537
  let f = [];
538
538
  for (let g of Object.keys(h).sort())
539
539
  f.push(...A(h[g], t));
540
- return T(y, e, f, u);
540
+ return T(y, e, f, c);
541
541
  }
542
542
  });
543
543
  });
@@ -545,7 +545,7 @@ const K = "sort-array-includes", me = j({
545
545
  }
546
546
  });
547
547
  }
548
- }), H = "sort-named-exports", be = j({
548
+ }), H = "sort-named-exports", be = I({
549
549
  name: H,
550
550
  meta: {
551
551
  type: "suggestion",
@@ -596,26 +596,26 @@ const K = "sort-array-includes", me = j({
596
596
  type: p.alphabetical,
597
597
  "ignore-case": !1,
598
598
  order: d.asc
599
- }), t = r.getSourceCode(), u = l.specifiers.map((n) => ({
600
- size: v(n.range),
601
- name: n.local.name,
602
- node: n
599
+ }), t = r.getSourceCode(), c = l.specifiers.map((a) => ({
600
+ size: j(a.range),
601
+ name: a.local.name,
602
+ node: a
603
603
  }));
604
- P(u, (n, e) => {
605
- k(O(n, e, s)) && r.report({
604
+ P(c, (a, e) => {
605
+ k(O(a, e, s)) && r.report({
606
606
  messageId: "unexpectedNamedExportsOrder",
607
607
  data: {
608
- left: n.name,
608
+ left: a.name,
609
609
  right: e.name
610
610
  },
611
611
  node: e.node,
612
- fix: (a) => T(a, u, A(u, s), t)
612
+ fix: (n) => T(n, c, A(c, s), t)
613
613
  });
614
614
  });
615
615
  }
616
616
  }
617
617
  })
618
- }), Q = "sort-named-imports", xe = j({
618
+ }), Q = "sort-named-imports", xe = I({
619
619
  name: Q,
620
620
  meta: {
621
621
  type: "suggestion",
@@ -674,23 +674,23 @@ const K = "sort-array-includes", me = j({
674
674
  "ignore-alias": !0,
675
675
  "ignore-case": !1,
676
676
  order: d.asc
677
- }), u = r.getSourceCode(), n = s.map((e) => {
678
- let { name: a } = e.local;
679
- return t["ignore-alias"] && e.type === "ImportSpecifier" && ({ name: a } = e.imported), {
680
- size: v(e.range),
677
+ }), c = r.getSourceCode(), a = s.map((e) => {
678
+ let { name: n } = e.local;
679
+ return t["ignore-alias"] && e.type === "ImportSpecifier" && ({ name: n } = e.imported), {
680
+ size: j(e.range),
681
681
  node: e,
682
- name: a
682
+ name: n
683
683
  };
684
684
  });
685
- P(n, (e, a) => {
686
- k(O(e, a, t)) && r.report({
685
+ P(a, (e, n) => {
686
+ k(O(e, n, t)) && r.report({
687
687
  messageId: "unexpectedNamedImportsOrder",
688
688
  data: {
689
689
  left: e.name,
690
- right: a.name
690
+ right: n.name
691
691
  },
692
- node: a.node,
693
- fix: (i) => T(i, n, A(n, t), u)
692
+ node: n.node,
693
+ fix: (i) => T(i, a, A(a, t), c)
694
694
  });
695
695
  });
696
696
  }
@@ -700,8 +700,8 @@ const K = "sort-array-includes", me = j({
700
700
  let B = (r, l, s) => r.lines.slice(
701
701
  l.node.loc.end.line,
702
702
  s.node.loc.start.line - 1
703
- ).filter((u) => !u.trim().length).length;
704
- const Y = "sort-object-types", Ee = j({
703
+ ).filter((c) => !c.trim().length).length;
704
+ const Y = "sort-object-types", Ee = I({
705
705
  name: Y,
706
706
  meta: {
707
707
  type: "suggestion",
@@ -766,50 +766,50 @@ const Y = "sort-object-types", Ee = j({
766
766
  order: d.asc,
767
767
  "custom-groups": {},
768
768
  groups: []
769
- }), t = r.getSourceCode(), u = l.members.reduce(
770
- (n, e) => {
769
+ }), t = r.getSourceCode(), c = l.members.reduce(
770
+ (a, e) => {
771
771
  var E, b, N, S;
772
- let a, i = t.text.slice(e.range.at(0), e.range.at(1)), o = (E = n.at(-1)) == null ? void 0 : E.at(-1), { getGroup: c, defineGroup: y, setCustomGroups: h } = R(
772
+ let n, i = t.text.slice(e.range.at(0), e.range.at(1)), o = (E = a.at(-1)) == null ? void 0 : E.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: h } = R(
773
773
  s.groups
774
774
  ), f = (L) => L.replace(/(,|;)$/, "");
775
775
  if (e.type === "TSPropertySignature")
776
- e.key.type === "Identifier" ? { name: a } = e.key : e.key.type === "Literal" ? a = `${e.key.value}` : a = t.text.slice(
776
+ e.key.type === "Identifier" ? { name: n } = e.key : e.key.type === "Literal" ? n = `${e.key.value}` : n = t.text.slice(
777
777
  e.range.at(0),
778
778
  (b = e.typeAnnotation) == null ? void 0 : b.range.at(0)
779
779
  );
780
780
  else if (e.type === "TSIndexSignature") {
781
781
  let L = ((N = e.typeAnnotation) == null ? void 0 : N.range.at(0)) ?? e.range.at(1);
782
- a = f(t.text.slice(e.range.at(0), L));
782
+ n = f(t.text.slice(e.range.at(0), L));
783
783
  } else
784
- a = f(
784
+ n = f(
785
785
  t.text.slice(e.range.at(0), e.range.at(1))
786
786
  );
787
- h(s["custom-groups"], a), e.loc.start.line !== e.loc.end.line && y("multiline");
787
+ h(s["custom-groups"], n), e.loc.start.line !== e.loc.end.line && y("multiline");
788
788
  let m = i.endsWith(";") || i.endsWith(",") ? 1 : 0, w = {
789
- size: v(e.range) - m,
789
+ size: j(e.range) - m,
790
790
  node: e,
791
- name: a
791
+ name: n
792
792
  };
793
- return s["partition-by-new-line"] && o && B(t, o, w) && n.push([]), (S = n.at(-1)) == null || S.push({
793
+ return s["partition-by-new-line"] && o && B(t, o, w) && a.push([]), (S = a.at(-1)) == null || S.push({
794
794
  ...w,
795
- group: c()
796
- }), n;
795
+ group: u()
796
+ }), a;
797
797
  },
798
798
  [[]]
799
799
  );
800
- for (let n of u)
801
- P(n, (e, a) => {
802
- let i = x(s.groups, e), o = x(s.groups, a);
803
- (i > o || i === o && k(O(e, a, s))) && r.report({
800
+ for (let a of c)
801
+ P(a, (e, n) => {
802
+ let i = x(s.groups, e), o = x(s.groups, n);
803
+ (i > o || i === o && k(O(e, n, s))) && r.report({
804
804
  messageId: "unexpectedObjectTypesOrder",
805
805
  data: {
806
- left: I(e.name),
807
- right: I(a.name)
806
+ left: v(e.name),
807
+ right: v(n.name)
808
808
  },
809
- node: a.node,
810
- fix: (c) => {
809
+ node: n.node,
810
+ fix: (u) => {
811
811
  let y = {};
812
- for (let f of n) {
812
+ for (let f of a) {
813
813
  let g = x(s.groups, f);
814
814
  g in y ? y[g] = A(
815
815
  [...y[g], f],
@@ -819,14 +819,14 @@ const Y = "sort-object-types", Ee = j({
819
819
  let h = [];
820
820
  for (let f of Object.keys(y).sort())
821
821
  h.push(...A(y[f], s));
822
- return T(c, n, h, t);
822
+ return T(u, a, h, t);
823
823
  }
824
824
  });
825
825
  });
826
826
  }
827
827
  }
828
828
  })
829
- }), Z = "sort-union-types", Se = j({
829
+ }), Z = "sort-union-types", Se = I({
830
830
  name: Z,
831
831
  meta: {
832
832
  type: "suggestion",
@@ -881,38 +881,38 @@ const Y = "sort-object-types", Ee = j({
881
881
  "nullable-last": !1,
882
882
  "ignore-case": !1,
883
883
  order: d.asc
884
- }), u = l.types.map((n) => ({
885
- group: n.type === "TSNullKeyword" || n.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
886
- name: s.text.slice(...n.range),
887
- size: v(n.range),
888
- node: n
884
+ }), c = l.types.map((a) => ({
885
+ group: a.type === "TSNullKeyword" || a.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
886
+ name: s.text.slice(...a.range),
887
+ size: j(a.range),
888
+ node: a
889
889
  }));
890
- P(u, (n, e) => {
891
- let a = k(O(n, e, t));
892
- t["nullable-last"] && (n.group === "nullable" && e.group === "unknown" ? a = !0 : n.group === "unknown" && e.group === "nullable" && (a = !1)), a && r.report({
890
+ P(c, (a, e) => {
891
+ let n = k(O(a, e, t));
892
+ t["nullable-last"] && (a.group === "nullable" && e.group === "unknown" ? n = !0 : a.group === "unknown" && e.group === "nullable" && (n = !1)), n && r.report({
893
893
  messageId: "unexpectedUnionTypesOrder",
894
894
  data: {
895
- left: I(n.name),
896
- right: I(e.name)
895
+ left: v(a.name),
896
+ right: v(e.name)
897
897
  },
898
898
  node: e.node,
899
899
  fix: (i) => {
900
900
  let o = [];
901
901
  if (t["nullable-last"]) {
902
- let c = [], y = u.filter((h) => h.group === "nullable" ? (c.push(h), !1) : !0);
902
+ let u = [], y = c.filter((h) => h.group === "nullable" ? (u.push(h), !1) : !0);
903
903
  o = [
904
904
  ...A(y, t),
905
- ...A(c, t)
905
+ ...A(u, t)
906
906
  ];
907
907
  } else
908
- o = A(u, t);
909
- return T(i, u, o, s);
908
+ o = A(c, t);
909
+ return T(i, c, o, s);
910
910
  }
911
911
  });
912
912
  });
913
913
  }
914
914
  })
915
- }), ee = "sort-interfaces", we = j({
915
+ }), ee = "sort-interfaces", we = I({
916
916
  name: ee,
917
917
  meta: {
918
918
  type: "suggestion",
@@ -990,12 +990,12 @@ const Y = "sort-object-types", Ee = j({
990
990
  nocomment: !0
991
991
  })
992
992
  )) {
993
- let t = r.getSourceCode(), u = l.body.body.reduce(
994
- (n, e) => {
993
+ let t = r.getSourceCode(), c = l.body.body.reduce(
994
+ (a, e) => {
995
995
  var f, g, m, w;
996
996
  if (e.type === "TSCallSignatureDeclaration")
997
- return n.push([]), n;
998
- let a = (f = n.at(-1)) == null ? void 0 : f.at(-1), i, { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
997
+ return a.push([]), a;
998
+ let n = (f = a.at(-1)) == null ? void 0 : f.at(-1), i, { getGroup: o, defineGroup: u, setCustomGroups: y } = R(
999
999
  s.groups
1000
1000
  );
1001
1001
  if (e.type === "TSPropertySignature")
@@ -1015,30 +1015,30 @@ const Y = "sort-object-types", Ee = j({
1015
1015
  i = t.text.slice(e.range.at(0), E);
1016
1016
  }
1017
1017
  let h = {
1018
- size: v(e.range),
1018
+ size: j(e.range),
1019
1019
  node: e,
1020
1020
  name: i
1021
1021
  };
1022
- return s["partition-by-new-line"] && a && B(t, a, h) && n.push([]), y(s["custom-groups"], i), e.loc.start.line !== e.loc.end.line && c("multiline"), n.at(-1).push({
1022
+ return s["partition-by-new-line"] && n && B(t, n, h) && a.push([]), y(s["custom-groups"], i), e.loc.start.line !== e.loc.end.line && u("multiline"), a.at(-1).push({
1023
1023
  ...h,
1024
1024
  group: o()
1025
- }), n;
1025
+ }), a;
1026
1026
  },
1027
1027
  [[]]
1028
1028
  );
1029
- for (let n of u)
1030
- P(n, (e, a) => {
1031
- let i = x(s.groups, e), o = x(s.groups, a);
1032
- (i > o || i === o && k(O(e, a, s))) && r.report({
1029
+ for (let a of c)
1030
+ P(a, (e, n) => {
1031
+ let i = x(s.groups, e), o = x(s.groups, n);
1032
+ (i > o || i === o && k(O(e, n, s))) && r.report({
1033
1033
  messageId: "unexpectedInterfacePropertiesOrder",
1034
1034
  data: {
1035
- left: I(e.name),
1036
- right: I(a.name)
1035
+ left: v(e.name),
1036
+ right: v(n.name)
1037
1037
  },
1038
- node: a.node,
1039
- fix: (c) => {
1038
+ node: n.node,
1039
+ fix: (u) => {
1040
1040
  let y = {};
1041
- for (let f of n) {
1041
+ for (let f of a) {
1042
1042
  let g = x(s.groups, f);
1043
1043
  g in y ? y[g] = A(
1044
1044
  [...y[g], f],
@@ -1048,7 +1048,7 @@ const Y = "sort-object-types", Ee = j({
1048
1048
  let h = [];
1049
1049
  for (let f of Object.keys(y).sort())
1050
1050
  h.push(...A(y[f], s));
1051
- return T(c, n, h, t);
1051
+ return T(u, a, h, t);
1052
1052
  }
1053
1053
  });
1054
1054
  });
@@ -1056,7 +1056,7 @@ const Y = "sort-object-types", Ee = j({
1056
1056
  }
1057
1057
  }
1058
1058
  })
1059
- }), te = "sort-jsx-props", Ae = j({
1059
+ }), te = "sort-jsx-props", Ae = I({
1060
1060
  name: te,
1061
1061
  meta: {
1062
1062
  type: "suggestion",
@@ -1117,37 +1117,37 @@ const Y = "sort-object-types", Ee = j({
1117
1117
  order: d.asc,
1118
1118
  "custom-groups": {},
1119
1119
  groups: []
1120
- }), t = r.getSourceCode(), u = l.openingElement.attributes.reduce(
1121
- (n, e) => {
1120
+ }), t = r.getSourceCode(), c = l.openingElement.attributes.reduce(
1121
+ (a, e) => {
1122
1122
  if (e.type === "JSXSpreadAttribute")
1123
- return n.push([]), n;
1124
- let a = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: i, defineGroup: o, setCustomGroups: c } = R(
1123
+ return a.push([]), a;
1124
+ let n = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: i, defineGroup: o, setCustomGroups: u } = R(
1125
1125
  s.groups
1126
1126
  );
1127
- c(s["custom-groups"], a), e.value === null && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline");
1127
+ u(s["custom-groups"], n), e.value === null && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline");
1128
1128
  let y = {
1129
- size: v(e.range),
1129
+ size: j(e.range),
1130
1130
  group: i(),
1131
1131
  node: e,
1132
- name: a
1132
+ name: n
1133
1133
  };
1134
- return n.at(-1).push(y), n;
1134
+ return a.at(-1).push(y), a;
1135
1135
  },
1136
1136
  [[]]
1137
1137
  );
1138
- for (let n of u)
1139
- P(n, (e, a) => {
1140
- let i = x(s.groups, e), o = x(s.groups, a);
1141
- (i > o || i === o && k(O(e, a, s))) && r.report({
1138
+ for (let a of c)
1139
+ P(a, (e, n) => {
1140
+ let i = x(s.groups, e), o = x(s.groups, n);
1141
+ (i > o || i === o && k(O(e, n, s))) && r.report({
1142
1142
  messageId: "unexpectedJSXPropsOrder",
1143
1143
  data: {
1144
1144
  left: e.name,
1145
- right: a.name
1145
+ right: n.name
1146
1146
  },
1147
- node: a.node,
1148
- fix: (c) => {
1147
+ node: n.node,
1148
+ fix: (u) => {
1149
1149
  let y = {};
1150
- for (let f of n) {
1150
+ for (let f of a) {
1151
1151
  let g = x(s.groups, f);
1152
1152
  g in y ? y[g] = A(
1153
1153
  [...y[g], f],
@@ -1157,14 +1157,14 @@ const Y = "sort-object-types", Ee = j({
1157
1157
  let h = [];
1158
1158
  for (let f of Object.keys(y).sort())
1159
1159
  h.push(...A(y[f], s));
1160
- return T(c, n, h, t);
1160
+ return T(u, a, h, t);
1161
1161
  }
1162
1162
  });
1163
1163
  });
1164
1164
  }
1165
1165
  }
1166
1166
  }
1167
- }), re = "sort-exports", Ne = j({
1167
+ }), re = "sort-exports", Ne = I({
1168
1168
  name: re,
1169
1169
  meta: {
1170
1170
  type: "suggestion",
@@ -1213,36 +1213,36 @@ const Y = "sort-object-types", Ee = j({
1213
1213
  type: p.alphabetical,
1214
1214
  order: d.asc,
1215
1215
  "ignore-case": !1
1216
- }), s = [[]], t = (u) => {
1217
- u.type === "ExportAllDeclaration" && u.exported === null ? s.push([]) : s.at(-1).push({
1218
- size: v(u.range),
1219
- name: u.source.value,
1220
- node: u
1216
+ }), s = [[]], t = (c) => {
1217
+ c.type === "ExportAllDeclaration" && c.exported === null ? s.push([]) : s.at(-1).push({
1218
+ size: j(c.range),
1219
+ name: c.source.value,
1220
+ node: c
1221
1221
  });
1222
1222
  };
1223
1223
  return {
1224
1224
  ExportAllDeclaration: t,
1225
- ExportNamedDeclaration: (u) => {
1226
- u.source !== null && t(u);
1225
+ ExportNamedDeclaration: (c) => {
1226
+ c.source !== null && t(c);
1227
1227
  },
1228
1228
  "Program:exit": () => {
1229
- let u = r.getSourceCode();
1230
- for (let n of s)
1231
- P(n, (e, a) => {
1232
- k(O(e, a, l)) && r.report({
1229
+ let c = r.getSourceCode();
1230
+ for (let a of s)
1231
+ P(a, (e, n) => {
1232
+ k(O(e, n, l)) && r.report({
1233
1233
  messageId: "unexpectedExportsOrder",
1234
1234
  data: {
1235
1235
  left: e.name,
1236
- right: a.name
1236
+ right: n.name
1237
1237
  },
1238
- node: a.node,
1239
- fix: (i) => T(i, n, A(n, l), u)
1238
+ node: n.node,
1239
+ fix: (i) => T(i, a, A(a, l), c)
1240
1240
  });
1241
1241
  });
1242
1242
  }
1243
1243
  };
1244
1244
  }
1245
- }), se = "sort-imports", Oe = j({
1245
+ }), se = "sort-imports", Oe = I({
1246
1246
  name: se,
1247
1247
  meta: {
1248
1248
  type: "suggestion",
@@ -1362,13 +1362,13 @@ const Y = "sort-object-types", Ee = j({
1362
1362
  }), s = !1;
1363
1363
  for (let o of l.groups)
1364
1364
  if (Array.isArray(o))
1365
- for (let c of o)
1366
- c === "unknown" && (s = !0);
1365
+ for (let u of o)
1366
+ u === "unknown" && (s = !0);
1367
1367
  else
1368
1368
  o === "unknown" && (s = !0);
1369
1369
  s || (l.groups = [...l.groups, "unknown"]);
1370
- let t = r.getSourceCode(), u = [], n = (o) => o.type === "ImportDeclaration" && o.specifiers.length === 0, e = (o) => {
1371
- let c = (S) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1370
+ let t = r.getSourceCode(), c = [], a = (o) => o.type === "ImportDeclaration" && o.specifiers.length === 0, e = (o) => {
1371
+ let u = (S) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1372
1372
  (L) => S.endsWith(L)
1373
1373
  ), y = (S) => [
1374
1374
  "./index.d.js",
@@ -1398,16 +1398,16 @@ const Y = "sort-object-types", Ee = j({
1398
1398
  S.startsWith("node:") ? S.split("node:")[1] : S
1399
1399
  ) || L.includes(S);
1400
1400
  }, N = (S) => !(S.startsWith(".") || S.startsWith("/"));
1401
- return o.importKind === "type" && (o.type === "ImportDeclaration" && (w(l["custom-groups"].type, o.source.value), y(o.source.value) && m("index-type"), f(o.source.value) && m("sibling-type"), h(o.source.value) && m("parent-type"), E(o) && m("internal-type"), b(o.source.value) && m("builtin-type"), N(o.source.value) && m("external-type")), m("type")), o.type === "ImportDeclaration" && (w(l["custom-groups"].value, o.source.value), n(o) && m("side-effect"), c(o.source.value) && m("style"), y(o.source.value) && m("index"), f(o.source.value) && m("sibling"), h(o.source.value) && m("parent"), E(o) && m("internal"), b(o.source.value) && m("builtin"), N(o.source.value) && m("external")), g();
1402
- }, a = (o) => o.specifiers.length > 1, i = (o) => {
1403
- let c;
1404
- o.type === "ImportDeclaration" ? c = o.source.value : o.moduleReference.type === "TSExternalModuleReference" && o.moduleReference.expression.type === "Literal" ? c = `${o.moduleReference.expression.value}` : c = t.text.slice(...o.moduleReference.range), u.push({
1405
- size: v(o.range),
1401
+ return o.importKind === "type" && (o.type === "ImportDeclaration" && (w(l["custom-groups"].type, o.source.value), y(o.source.value) && m("index-type"), f(o.source.value) && m("sibling-type"), h(o.source.value) && m("parent-type"), E(o) && m("internal-type"), b(o.source.value) && m("builtin-type"), N(o.source.value) && m("external-type")), m("type")), o.type === "ImportDeclaration" && (w(l["custom-groups"].value, o.source.value), a(o) && u(o.source.value) && m("side-effect-style"), a(o) && m("side-effect"), u(o.source.value) && m("style"), y(o.source.value) && m("index"), f(o.source.value) && m("sibling"), h(o.source.value) && m("parent"), E(o) && m("internal"), b(o.source.value) && m("builtin"), N(o.source.value) && m("external")), g();
1402
+ }, n = (o) => o.specifiers.length > 1, i = (o) => {
1403
+ let u;
1404
+ o.type === "ImportDeclaration" ? u = o.source.value : o.moduleReference.type === "TSExternalModuleReference" && o.moduleReference.expression.type === "Literal" ? u = `${o.moduleReference.expression.value}` : u = t.text.slice(...o.moduleReference.range), c.push({
1405
+ size: j(o.range),
1406
1406
  group: e(o),
1407
- name: c,
1407
+ name: u,
1408
1408
  node: o,
1409
1409
  ...l.type === p["line-length"] && l["max-line-length"] && {
1410
- hasMultipleImportDeclarations: a(
1410
+ hasMultipleImportDeclarations: n(
1411
1411
  o
1412
1412
  )
1413
1413
  }
@@ -1424,7 +1424,7 @@ const Y = "sort-object-types", Ee = j({
1424
1424
  {
1425
1425
  includeComments: !0
1426
1426
  }
1427
- ).length, c = (f, g) => {
1427
+ ).length, u = (f, g) => {
1428
1428
  let m = [], w = {};
1429
1429
  for (let b of g) {
1430
1430
  let N = x(l.groups, b);
@@ -1483,21 +1483,21 @@ const Y = "sort-object-types", Ee = j({
1483
1483
  }
1484
1484
  return m;
1485
1485
  }, y = [[]];
1486
- for (let f of u) {
1486
+ for (let f of c) {
1487
1487
  let g = (h = y.at(-1)) == null ? void 0 : h.at(-1);
1488
1488
  g && o(g, f) ? y.push([f]) : y.at(-1).push(f);
1489
1489
  }
1490
1490
  for (let f of y)
1491
1491
  P(f, (g, m) => {
1492
1492
  let w = x(l.groups, g), E = x(l.groups, m), b = B(t, g, m);
1493
- !(n(g.node) && n(m.node)) && !o(g, m) && (w > E || w === E && k(O(g, m, l))) && r.report({
1493
+ !(a(g.node) && a(m.node)) && !o(g, m) && (w > E || w === E && k(O(g, m, l))) && r.report({
1494
1494
  messageId: "unexpectedImportsOrder",
1495
1495
  data: {
1496
1496
  left: g.name,
1497
1497
  right: m.name
1498
1498
  },
1499
1499
  node: m.node,
1500
- fix: (N) => c(N, f)
1500
+ fix: (N) => u(N, f)
1501
1501
  }), l["newlines-between"] === "never" && b > 0 && r.report({
1502
1502
  messageId: "extraSpacingBetweenImports",
1503
1503
  data: {
@@ -1505,7 +1505,7 @@ const Y = "sort-object-types", Ee = j({
1505
1505
  right: m.name
1506
1506
  },
1507
1507
  node: m.node,
1508
- fix: (N) => c(N, f)
1508
+ fix: (N) => u(N, f)
1509
1509
  }), l["newlines-between"] === "always" && (w < E && b === 0 ? r.report({
1510
1510
  messageId: "missedSpacingBetweenImports",
1511
1511
  data: {
@@ -1513,7 +1513,7 @@ const Y = "sort-object-types", Ee = j({
1513
1513
  right: m.name
1514
1514
  },
1515
1515
  node: m.node,
1516
- fix: (N) => c(N, f)
1516
+ fix: (N) => u(N, f)
1517
1517
  }) : (b > 1 || w === E && b > 0) && r.report({
1518
1518
  messageId: "extraSpacingBetweenImports",
1519
1519
  data: {
@@ -1521,13 +1521,13 @@ const Y = "sort-object-types", Ee = j({
1521
1521
  right: m.name
1522
1522
  },
1523
1523
  node: m.node,
1524
- fix: (N) => c(N, f)
1524
+ fix: (N) => u(N, f)
1525
1525
  }));
1526
1526
  });
1527
1527
  }
1528
1528
  };
1529
1529
  }
1530
- }), ae = "sort-objects", Ie = j({
1530
+ }), ae = "sort-objects", ve = I({
1531
1531
  name: ae,
1532
1532
  meta: {
1533
1533
  type: "suggestion",
@@ -1601,27 +1601,27 @@ const Y = "sort-object-types", Ee = j({
1601
1601
  order: d.asc,
1602
1602
  "custom-groups": {},
1603
1603
  groups: []
1604
- }), u = (i) => i.type === "Identifier" && i.name === "styled", n = (i) => i !== void 0 && i.type === "CallExpression" && (i.callee.type === "MemberExpression" && u(i.callee.object) || i.callee.type === "CallExpression" && u(i.callee.callee));
1605
- if (!t["styled-components"] && (n(s.parent) || s.parent.type === "ArrowFunctionExpression" && n(s.parent.parent)))
1604
+ }), c = (i) => i.type === "Identifier" && i.name === "styled", a = (i) => i !== void 0 && i.type === "CallExpression" && (i.callee.type === "MemberExpression" && c(i.callee.object) || i.callee.type === "CallExpression" && c(i.callee.callee));
1605
+ if (!t["styled-components"] && (a(s.parent) || s.parent.type === "ArrowFunctionExpression" && a(s.parent.parent)))
1606
1606
  return;
1607
- let e = r.getSourceCode(), a = (i) => i.reduce(
1608
- (o, c) => {
1607
+ let e = r.getSourceCode(), n = (i) => i.reduce(
1608
+ (o, u) => {
1609
1609
  var S;
1610
- if (c.type === "SpreadElement" || c.type === "RestElement")
1610
+ if (u.type === "SpreadElement" || u.type === "RestElement")
1611
1611
  return o.push([]), o;
1612
- let y = J(c, e), h = (S = o.at(-1)) == null ? void 0 : S.at(-1);
1612
+ let y = J(u, e), h = (S = o.at(-1)) == null ? void 0 : S.at(-1);
1613
1613
  t["partition-by-comment"] && y && pe(
1614
1614
  t["partition-by-comment"],
1615
1615
  y.value
1616
1616
  ) && o.push([]);
1617
1617
  let f, g = "ignore", m = [], { getGroup: w, setCustomGroups: E } = R(t.groups);
1618
- c.key.type === "Identifier" ? { name: f } = c.key : c.key.type === "Literal" ? f = `${c.key.value}` : f = e.text.slice(...c.key.range);
1618
+ u.key.type === "Identifier" ? { name: f } = u.key : u.key.type === "Literal" ? f = `${u.key.value}` : f = e.text.slice(...u.key.range);
1619
1619
  let b = {
1620
- size: v(c.range),
1621
- node: c,
1620
+ size: j(u.range),
1621
+ node: u,
1622
1622
  name: f
1623
1623
  };
1624
- t["partition-by-new-line"] && h && B(e, h, b) && o.push([]), c.value.type === "AssignmentPattern" && ((G) => {
1624
+ t["partition-by-new-line"] && h && B(e, h, b) && o.push([]), u.value.type === "AssignmentPattern" && ((G) => {
1625
1625
  G.right.type === "Identifier" && m.push(G.right.name);
1626
1626
  let ie = ($) => {
1627
1627
  let U = [];
@@ -1653,7 +1653,7 @@ const Y = "sort-object-types", Ee = j({
1653
1653
  ie(G.right);
1654
1654
  break;
1655
1655
  }
1656
- })(c.value), E(t["custom-groups"], f);
1656
+ })(u.value), E(t["custom-groups"], f);
1657
1657
  let N = {
1658
1658
  ...b,
1659
1659
  group: w(),
@@ -1664,10 +1664,10 @@ const Y = "sort-object-types", Ee = j({
1664
1664
  },
1665
1665
  [[]]
1666
1666
  );
1667
- for (let i of a(s.properties))
1668
- P(i, (o, c) => {
1669
- let y = x(t.groups, o), h = x(t.groups, c);
1670
- if (y > h || y === h && k(O(o, c, t))) {
1667
+ for (let i of n(s.properties))
1668
+ P(i, (o, u) => {
1669
+ let y = x(t.groups, o), h = x(t.groups, u);
1670
+ if (y > h || y === h && k(O(o, u, t))) {
1671
1671
  let f = (g) => {
1672
1672
  let m = {};
1673
1673
  for (let E of i) {
@@ -1687,10 +1687,10 @@ const Y = "sort-object-types", Ee = j({
1687
1687
  r.report({
1688
1688
  messageId: "unexpectedObjectsOrder",
1689
1689
  data: {
1690
- left: I(o.name),
1691
- right: I(c.name)
1690
+ left: v(o.name),
1691
+ right: v(u.name)
1692
1692
  },
1693
- node: c.node,
1693
+ node: u.node,
1694
1694
  fix: f
1695
1695
  });
1696
1696
  }
@@ -1702,7 +1702,7 @@ const Y = "sort-object-types", Ee = j({
1702
1702
  ObjectPattern: l
1703
1703
  };
1704
1704
  }
1705
- }), ne = "sort-classes", je = j({
1705
+ }), ne = "sort-classes", Ie = I({
1706
1706
  name: ne,
1707
1707
  meta: {
1708
1708
  type: "suggestion",
@@ -1758,38 +1758,38 @@ const Y = "sort-object-types", Ee = j({
1758
1758
  order: d.asc,
1759
1759
  "ignore-case": !1,
1760
1760
  groups: ["property", "constructor", "method", "unknown"]
1761
- }), t = r.getSourceCode(), u = l.body.map((n) => {
1762
- var c;
1763
- let e, { getGroup: a, defineGroup: i } = R(s.groups);
1764
- n.type === "StaticBlock" ? e = "static" : n.type === "TSIndexSignature" ? e = t.text.slice(
1765
- n.range.at(0),
1766
- ((c = n.typeAnnotation) == null ? void 0 : c.range.at(0)) ?? n.range.at(1)
1767
- ) : n.key.type === "Identifier" ? { name: e } = n.key : e = t.text.slice(...n.key.range);
1761
+ }), t = r.getSourceCode(), c = l.body.map((a) => {
1762
+ var u;
1763
+ let e, { getGroup: n, defineGroup: i } = R(s.groups);
1764
+ a.type === "StaticBlock" ? e = "static" : a.type === "TSIndexSignature" ? e = t.text.slice(
1765
+ a.range.at(0),
1766
+ ((u = a.typeAnnotation) == null ? void 0 : u.range.at(0)) ?? a.range.at(1)
1767
+ ) : a.key.type === "Identifier" ? { name: e } = a.key : e = t.text.slice(...a.key.range);
1768
1768
  let o = e.startsWith("_") || e.startsWith("#");
1769
- if (n.type === "MethodDefinition") {
1770
- n.kind === "constructor" && i("constructor");
1771
- let y = n.accessibility === "private" || o, h = n.static;
1772
- y && h && i("static-private-method"), y && i("private-method"), h && i("static-method"), n.kind === "get" && i("get-method"), n.kind === "set" && i("set-method"), i("method");
1769
+ if (a.type === "MethodDefinition") {
1770
+ a.kind === "constructor" && i("constructor");
1771
+ let y = a.accessibility === "private" || o, h = a.static;
1772
+ y && h && i("static-private-method"), y && i("private-method"), h && i("static-method"), a.kind === "get" && i("get-method"), a.kind === "set" && i("set-method"), i("method");
1773
1773
  } else
1774
- n.type === "TSIndexSignature" ? i("index-signature") : n.type === "PropertyDefinition" && ((n.accessibility === "private" || o) && i("private-property"), n.static && i("static-property"), i("property"));
1774
+ a.type === "TSIndexSignature" ? i("index-signature") : a.type === "PropertyDefinition" && ((a.accessibility === "private" || o) && i("private-property"), a.static && i("static-property"), i("property"));
1775
1775
  return {
1776
- size: v(n.range),
1777
- group: a(),
1778
- node: n,
1776
+ size: j(a.range),
1777
+ group: n(),
1778
+ node: a,
1779
1779
  name: e
1780
1780
  };
1781
1781
  });
1782
- P(u, (n, e) => {
1783
- let a = x(s.groups, n), i = x(s.groups, e);
1784
- n.name !== e.name && (a > i || a === i && k(O(n, e, s))) && r.report({
1782
+ P(c, (a, e) => {
1783
+ let n = x(s.groups, a), i = x(s.groups, e);
1784
+ a.name !== e.name && (n > i || n === i && k(O(a, e, s))) && r.report({
1785
1785
  messageId: "unexpectedClassesOrder",
1786
1786
  data: {
1787
- left: I(n.name),
1788
- right: I(e.name)
1787
+ left: v(a.name),
1788
+ right: v(e.name)
1789
1789
  },
1790
1790
  node: e.node,
1791
1791
  fix: (o) => {
1792
- let c = [], y = u.reduce(
1792
+ let u = [], y = c.reduce(
1793
1793
  (f, g) => {
1794
1794
  let m = x(s.groups, g);
1795
1795
  return m in f ? f[m] = A(
@@ -1806,22 +1806,22 @@ const Y = "sort-object-types", Ee = j({
1806
1806
  []
1807
1807
  );
1808
1808
  for (let f = 0, g = h.length; f < g; f++)
1809
- c.push(
1809
+ u.push(
1810
1810
  o.replaceTextRange(
1811
- M(u.at(f).node, t),
1811
+ M(c.at(f).node, t),
1812
1812
  t.text.slice(
1813
1813
  ...M(h.at(f).node, t)
1814
1814
  )
1815
1815
  )
1816
1816
  );
1817
- return c;
1817
+ return u;
1818
1818
  }
1819
1819
  });
1820
1820
  });
1821
1821
  }
1822
1822
  }
1823
1823
  })
1824
- }), oe = "sort-enums", ve = j({
1824
+ }), oe = "sort-enums", je = I({
1825
1825
  name: oe,
1826
1826
  meta: {
1827
1827
  type: "suggestion",
@@ -1872,26 +1872,26 @@ const Y = "sort-object-types", Ee = j({
1872
1872
  type: p.alphabetical,
1873
1873
  order: d.asc,
1874
1874
  "ignore-case": !1
1875
- }), t = r.getSourceCode(), u = l.members.map((n) => ({
1876
- name: n.id.type === "Literal" ? `${n.id.value}` : `${t.text.slice(...n.id.range)}`,
1877
- size: v(n.range),
1878
- node: n
1875
+ }), t = r.getSourceCode(), c = l.members.map((a) => ({
1876
+ name: a.id.type === "Literal" ? `${a.id.value}` : `${t.text.slice(...a.id.range)}`,
1877
+ size: j(a.range),
1878
+ node: a
1879
1879
  }));
1880
- P(u, (n, e) => {
1881
- k(O(n, e, s)) && r.report({
1880
+ P(c, (a, e) => {
1881
+ k(O(a, e, s)) && r.report({
1882
1882
  messageId: "unexpectedEnumsOrder",
1883
1883
  data: {
1884
- left: I(n.name),
1885
- right: I(e.name)
1884
+ left: v(a.name),
1885
+ right: v(e.name)
1886
1886
  },
1887
1887
  node: e.node,
1888
- fix: (a) => T(a, u, A(u, s), t)
1888
+ fix: (n) => T(n, c, A(c, s), t)
1889
1889
  });
1890
1890
  });
1891
1891
  }
1892
1892
  }
1893
1893
  })
1894
- }), le = "sort-maps", ke = j({
1894
+ }), le = "sort-maps", ke = I({
1895
1895
  name: le,
1896
1896
  meta: {
1897
1897
  type: "suggestion",
@@ -1944,33 +1944,33 @@ const Y = "sort-object-types", Ee = j({
1944
1944
  type: p.alphabetical,
1945
1945
  "ignore-case": !1,
1946
1946
  order: d.asc
1947
- }), u = r.getSourceCode(), n = s.reduce(
1948
- (e, a) => (a === null || a.type === "SpreadElement" ? e.push([]) : e.at(-1).push(a), e),
1947
+ }), c = r.getSourceCode(), a = s.reduce(
1948
+ (e, n) => (n === null || n.type === "SpreadElement" ? e.push([]) : e.at(-1).push(n), e),
1949
1949
  [[]]
1950
1950
  );
1951
- for (let e of n) {
1952
- let a = e.map((i) => {
1951
+ for (let e of a) {
1952
+ let n = e.map((i) => {
1953
1953
  let o;
1954
1954
  if (i.type === "ArrayExpression") {
1955
- let [c] = i.elements;
1956
- c ? c.type === "Literal" ? o = c.raw : o = u.text.slice(...c.range) : o = `${c}`;
1955
+ let [u] = i.elements;
1956
+ u ? u.type === "Literal" ? o = u.raw : o = c.text.slice(...u.range) : o = `${u}`;
1957
1957
  } else
1958
- o = u.text.slice(...i.range);
1958
+ o = c.text.slice(...i.range);
1959
1959
  return {
1960
- size: v(i.range),
1960
+ size: j(i.range),
1961
1961
  node: i,
1962
1962
  name: o
1963
1963
  };
1964
1964
  });
1965
- P(a, (i, o) => {
1965
+ P(n, (i, o) => {
1966
1966
  k(O(i, o, t)) && r.report({
1967
1967
  messageId: "unexpectedMapElementsOrder",
1968
1968
  data: {
1969
- left: I(i.name),
1970
- right: I(o.name)
1969
+ left: v(i.name),
1970
+ right: v(o.name)
1971
1971
  },
1972
1972
  node: o.node,
1973
- fix: (c) => T(c, a, A(a, t), u)
1973
+ fix: (u) => T(u, n, A(n, t), c)
1974
1974
  });
1975
1975
  });
1976
1976
  }
@@ -2046,9 +2046,9 @@ let V = (r) => {
2046
2046
  };
2047
2047
  return {
2048
2048
  rules: Object.fromEntries(
2049
- Object.entries(l).map(([s, [t, u = {}]]) => [
2049
+ Object.entries(l).map(([s, [t, c = {}]]) => [
2050
2050
  `perfectionist/${s}`,
2051
- [t, Object.assign(u, r)]
2051
+ [t, Object.assign(c, r)]
2052
2052
  ])
2053
2053
  ),
2054
2054
  plugins: ["perfectionist"]
@@ -2058,8 +2058,8 @@ const Re = {
2058
2058
  rules: {
2059
2059
  [K]: me,
2060
2060
  [q]: ye,
2061
- [ne]: je,
2062
- [oe]: ve,
2061
+ [ne]: Ie,
2062
+ [oe]: je,
2063
2063
  [re]: Ne,
2064
2064
  [se]: Oe,
2065
2065
  [ee]: we,
@@ -2068,7 +2068,7 @@ const Re = {
2068
2068
  [H]: be,
2069
2069
  [Q]: xe,
2070
2070
  [Y]: Ee,
2071
- [ae]: Ie,
2071
+ [ae]: ve,
2072
2072
  [X]: ge,
2073
2073
  [Z]: Se,
2074
2074
  [F]: he