eslint-plugin-perfectionist 2.4.2 → 2.6.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
@@ -1,23 +1,23 @@
1
- import B from "node:path";
2
- import { ESLintUtils as pe, ASTUtils as _ } from "@typescript-eslint/utils";
1
+ import _ from "node:path";
2
+ import { ESLintUtils as ue, ASTUtils as W } from "@typescript-eslint/utils";
3
3
  import { minimatch as $ } from "minimatch";
4
- import ue from "natural-compare-lite";
5
- import { builtinModules as de } from "node:module";
6
- let O = pe.RuleCreator(
4
+ import de from "natural-compare-lite";
5
+ import { builtinModules as ce } from "node:module";
6
+ let I = ue.RuleCreator(
7
7
  (t) => `https://eslint-plugin-perfectionist.azat.io/rules/${t}`
8
- ), x = (t, n) => {
8
+ ), E = (t, n) => {
9
9
  for (let s = 0, l = t.length; s < l; s++) {
10
10
  let r = t[s];
11
11
  if (n.group === r || Array.isArray(r) && typeof n.group == "string" && r.includes(n.group))
12
12
  return s;
13
13
  }
14
14
  return t.length;
15
- }, v = (t) => {
15
+ }, O = (t) => {
16
16
  let [n, s] = t;
17
17
  return s - n;
18
- }, I = (t) => t > 0;
19
- var p = /* @__PURE__ */ ((t) => (t.alphabetical = "alphabetical", t["line-length"] = "line-length", t.natural = "natural", t))(p || {}), g = /* @__PURE__ */ ((t) => (t.desc = "desc", t.asc = "asc", t))(g || {});
20
- let G = (t) => {
18
+ }, j = (t) => t > 0;
19
+ var p = /* @__PURE__ */ ((t) => (t.alphabetical = "alphabetical", t["line-length"] = "line-length", t.natural = "natural", t))(p || {}), f = /* @__PURE__ */ ((t) => (t.desc = "desc", t.asc = "asc", t))(f || {});
20
+ let M = (t) => {
21
21
  let n, s = (r) => {
22
22
  !n && t.flat().includes(r) && (n = r);
23
23
  };
@@ -36,34 +36,34 @@ let G = (t) => {
36
36
  },
37
37
  defineGroup: s
38
38
  };
39
- }, S = (t, n, s) => {
39
+ }, v = (t, n, s) => {
40
40
  var a, i;
41
41
  if ((a = n.dependencies) != null && a.includes(t.name))
42
42
  return -1;
43
43
  if ((i = t.dependencies) != null && i.includes(n.name))
44
44
  return 1;
45
45
  let l = s.order === "asc" ? 1 : -1, r, e = (o) => s["ignore-case"] ? o.toLowerCase() : o;
46
- return s.type === p.alphabetical ? r = (o, u) => e(o.name).localeCompare(e(u.name)) : s.type === p.natural ? r = (o, u) => ue(e(o.name), e(u.name)) : r = (o, u) => {
46
+ return s.type === p.alphabetical ? r = (o, u) => e(o.name).localeCompare(e(u.name)) : s.type === p.natural ? r = (o, u) => de(e(o.name), e(u.name)) : r = (o, u) => {
47
47
  let y = o.size, m = u.size, c = s["max-line-length"];
48
48
  if (c) {
49
- let d = (f, b) => f > c && b.hasMultipleImportDeclarations;
49
+ let d = (g, b) => g > c && b.hasMultipleImportDeclarations;
50
50
  d(y, o) && (y = o.name.length + 10), d(m, u) && (m = u.name.length + 10);
51
51
  }
52
52
  return y - m;
53
53
  }, l * r(t, n);
54
- }, w = (t, n) => [...t].sort((s, l) => S(s, l, n)), ce = (t, n) => {
54
+ }, w = (t, n) => [...t].sort((s, l) => v(s, l, n)), fe = (t, n) => {
55
55
  let s = n.getTokenAfter(t, {
56
56
  filter: ({ value: l, type: r }) => !(r === "Punctuator" && [",", ";"].includes(l)),
57
57
  includeComments: !0
58
58
  });
59
59
  return ((s == null ? void 0 : s.type) === "Block" || (s == null ? void 0 : s.type) === "Line") && t.loc.end.line === s.loc.end.line ? s : null;
60
- }, ie = (t, n) => Array.isArray(t) && t.some(
60
+ }, pe = (t, n) => Array.isArray(t) && t.some(
61
61
  (s) => $(n.trim(), s, {
62
62
  nocomment: !0
63
63
  })
64
64
  ) || typeof t == "string" && $(n.trim(), t, {
65
65
  nocomment: !0
66
- }) || t === !0, V = (t, n) => {
66
+ }) || t === !0, J = (t, n) => {
67
67
  let [s, l] = n.getTokensBefore(t, {
68
68
  filter: ({ value: r, type: e }) => !(e === "Punctuator" && [",", ";"].includes(r)),
69
69
  includeComments: !0,
@@ -73,17 +73,17 @@ let G = (t) => {
73
73
  }, T = (t, n, s) => {
74
74
  var i;
75
75
  let l = t.range.at(0), r = t.range.at(1), e = n.text.slice(l, r);
76
- if (_.isParenthesized(t, n)) {
76
+ if (W.isParenthesized(t, n)) {
77
77
  let o = n.getTokenBefore(
78
78
  t,
79
- _.isOpeningParenToken
79
+ W.isOpeningParenToken
80
80
  ), u = n.getTokenAfter(
81
81
  t,
82
- _.isClosingParenToken
82
+ W.isClosingParenToken
83
83
  );
84
84
  l = o.range.at(0), r = u.range.at(1);
85
85
  }
86
- let a = V(t, n);
86
+ let a = J(t, n);
87
87
  if (e.endsWith(";") || e.endsWith(",")) {
88
88
  let o = n.getTokensAfter(t, {
89
89
  includeComments: !0,
@@ -91,7 +91,7 @@ let G = (t) => {
91
91
  });
92
92
  t.loc.start.line === ((i = o.at(1)) == null ? void 0 : i.loc.start.line) && (r -= 1);
93
93
  }
94
- return a && !ie(
94
+ return a && !pe(
95
95
  (s == null ? void 0 : s.partitionComment) ?? !1,
96
96
  a.value
97
97
  ) && (l = a.range.at(0)), [l, r];
@@ -108,32 +108,32 @@ let G = (t) => {
108
108
  )
109
109
  )
110
110
  );
111
- let c = ce(s.at(u).node, l);
111
+ let c = fe(s.at(u).node, l);
112
112
  if (c && !a) {
113
- let f = [
113
+ let g = [
114
114
  l.getTokenBefore(c).range.at(1),
115
115
  c.range.at(1)
116
116
  ];
117
- e.push(t.replaceTextRange(f, ""));
117
+ e.push(t.replaceTextRange(g, ""));
118
118
  let b = l.getTokenAfter(m);
119
119
  e.push(
120
120
  t.insertTextAfter(
121
121
  (b == null ? void 0 : b.loc.end.line) === m.loc.end.line ? b : m,
122
- l.text.slice(...f)
122
+ l.text.slice(...g)
123
123
  )
124
124
  );
125
125
  }
126
126
  }
127
127
  return e;
128
- }, j = (t = {}, n) => Object.assign(n, t), k = (t, n) => {
128
+ }, k = (t = {}, n) => Object.assign(n, t), P = (t, n) => {
129
129
  if (t.length > 1)
130
130
  for (let s = 1; s < t.length; s++) {
131
131
  let l = t.at(s - 1), r = t.at(s);
132
132
  l && r && n(l, r, s - 1);
133
133
  }
134
134
  };
135
- const J = "sort-svelte-attributes", fe = O({
136
- name: J,
135
+ const X = "sort-svelte-attributes", ge = I({
136
+ name: X,
137
137
  meta: {
138
138
  type: "suggestion",
139
139
  docs: {
@@ -157,8 +157,8 @@ const J = "sort-svelte-attributes", fe = O({
157
157
  type: "string"
158
158
  },
159
159
  order: {
160
- enum: [g.asc, g.desc],
161
- default: g.asc,
160
+ enum: [f.asc, f.desc],
161
+ default: f.asc,
162
162
  type: "string"
163
163
  },
164
164
  "ignore-case": {
@@ -179,15 +179,15 @@ const J = "sort-svelte-attributes", fe = O({
179
179
  defaultOptions: [
180
180
  {
181
181
  type: p.alphabetical,
182
- order: g.asc
182
+ order: f.asc
183
183
  }
184
184
  ],
185
- create: (t) => B.extname(t.filename) !== ".svelte" ? {} : {
185
+ create: (t) => _.extname(t.filename) !== ".svelte" ? {} : {
186
186
  SvelteStartTag: (n) => {
187
187
  if (n.attributes.length > 1) {
188
- let s = j(t.options.at(0), {
188
+ let s = k(t.options.at(0), {
189
189
  type: p.alphabetical,
190
- order: g.asc,
190
+ order: f.asc,
191
191
  "ignore-case": !1,
192
192
  "custom-groups": {},
193
193
  groups: []
@@ -195,11 +195,11 @@ const J = "sort-svelte-attributes", fe = O({
195
195
  (r, e) => {
196
196
  if (e.type === "SvelteSpreadAttribute")
197
197
  return r.push([]), r;
198
- let a, { getGroup: i, defineGroup: o, setCustomGroups: u } = G(
198
+ let a, { getGroup: i, defineGroup: o, setCustomGroups: u } = M(
199
199
  s.groups
200
200
  );
201
201
  return e.key.type === "SvelteSpecialDirectiveKey" ? a = t.sourceCode.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: a } = e.key : a = t.sourceCode.text.slice(...e.key.range), u(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"), r.at(-1).push({
202
- size: v(e.range),
202
+ size: O(e.range),
203
203
  node: e,
204
204
  group: i(),
205
205
  name: a
@@ -208,9 +208,9 @@ const J = "sort-svelte-attributes", fe = O({
208
208
  [[]]
209
209
  );
210
210
  for (let r of l)
211
- k(r, (e, a) => {
212
- let i = x(s.groups, e), o = x(s.groups, a);
213
- (i > o || i === o && I(S(e, a, s))) && t.report({
211
+ P(r, (e, a) => {
212
+ let i = E(s.groups, e), o = E(s.groups, a);
213
+ (i > o || i === o && j(v(e, a, s))) && t.report({
214
214
  messageId: "unexpectedSvelteAttributesOrder",
215
215
  data: {
216
216
  left: e.name,
@@ -220,7 +220,7 @@ const J = "sort-svelte-attributes", fe = O({
220
220
  fix: (u) => {
221
221
  let y = {};
222
222
  for (let c of r) {
223
- let d = x(s.groups, c);
223
+ let d = E(s.groups, c);
224
224
  d in y ? y[d] = w(
225
225
  [...y[d], c],
226
226
  s
@@ -228,7 +228,7 @@ const J = "sort-svelte-attributes", fe = O({
228
228
  }
229
229
  let m = [];
230
230
  for (let c of Object.keys(y).sort(
231
- (d, f) => Number(d) - Number(f)
231
+ (d, g) => Number(d) - Number(g)
232
232
  ))
233
233
  m.push(...w(y[c], s));
234
234
  return L(
@@ -243,8 +243,8 @@ const J = "sort-svelte-attributes", fe = O({
243
243
  }
244
244
  }
245
245
  }
246
- }), X = "sort-astro-attributes", ge = O({
247
- name: X,
246
+ }), q = "sort-astro-attributes", ye = I({
247
+ name: q,
248
248
  meta: {
249
249
  type: "suggestion",
250
250
  docs: {
@@ -268,8 +268,8 @@ const J = "sort-svelte-attributes", fe = O({
268
268
  type: "string"
269
269
  },
270
270
  order: {
271
- enum: [g.asc, g.desc],
272
- default: g.asc,
271
+ enum: [f.asc, f.desc],
272
+ default: f.asc,
273
273
  type: "string"
274
274
  },
275
275
  "ignore-case": {
@@ -290,17 +290,17 @@ const J = "sort-svelte-attributes", fe = O({
290
290
  defaultOptions: [
291
291
  {
292
292
  type: p.alphabetical,
293
- order: g.asc
293
+ order: f.asc
294
294
  }
295
295
  ],
296
296
  // @ts-ignore
297
- create: (t) => B.extname(t.filename) !== ".astro" ? {} : {
297
+ create: (t) => _.extname(t.filename) !== ".astro" ? {} : {
298
298
  JSXElement: (n) => {
299
299
  let { attributes: s } = n.openingElement;
300
300
  if (s.length > 1) {
301
- let l = j(t.options.at(0), {
301
+ let l = k(t.options.at(0), {
302
302
  type: p.alphabetical,
303
- order: g.asc,
303
+ order: f.asc,
304
304
  "ignore-case": !1,
305
305
  "custom-groups": {},
306
306
  groups: []
@@ -308,11 +308,11 @@ const J = "sort-svelte-attributes", fe = O({
308
308
  (e, a) => {
309
309
  if (a.type === "JSXSpreadAttribute")
310
310
  return e.push([]), e;
311
- let i = typeof a.name.name == "string" ? a.name.name : t.sourceCode.text.slice(...a.name.range), { getGroup: o, defineGroup: u, setCustomGroups: y } = G(
311
+ let i = typeof a.name.name == "string" ? a.name.name : t.sourceCode.text.slice(...a.name.range), { getGroup: o, defineGroup: u, setCustomGroups: y } = M(
312
312
  l.groups
313
313
  );
314
314
  return y(l["custom-groups"], i), a.type === "AstroShorthandAttribute" && (u("astro-shorthand"), u("shorthand")), a.value === null && u("shorthand"), a.loc.start.line !== a.loc.end.line && u("multiline"), e.at(-1).push({
315
- size: v(a.range),
315
+ size: O(a.range),
316
316
  node: a,
317
317
  group: o(),
318
318
  name: i
@@ -321,9 +321,9 @@ const J = "sort-svelte-attributes", fe = O({
321
321
  [[]]
322
322
  );
323
323
  for (let e of r)
324
- k(e, (a, i) => {
325
- let o = x(l.groups, a), u = x(l.groups, i);
326
- (o > u || o === u && I(S(a, i, l))) && t.report({
324
+ P(e, (a, i) => {
325
+ let o = E(l.groups, a), u = E(l.groups, i);
326
+ (o > u || o === u && j(v(a, i, l))) && t.report({
327
327
  messageId: "unexpectedAstroAttributesOrder",
328
328
  data: {
329
329
  left: a.name,
@@ -333,15 +333,15 @@ const J = "sort-svelte-attributes", fe = O({
333
333
  fix: (y) => {
334
334
  let m = {};
335
335
  for (let d of e) {
336
- let f = x(l.groups, d);
337
- f in m ? m[f] = w(
338
- [...m[f], d],
336
+ let g = E(l.groups, d);
337
+ g in m ? m[g] = w(
338
+ [...m[g], d],
339
339
  l
340
- ) : m[f] = [d];
340
+ ) : m[g] = [d];
341
341
  }
342
342
  let c = [];
343
343
  for (let d of Object.keys(m).sort(
344
- (f, b) => Number(f) - Number(b)
344
+ (g, b) => Number(g) - Number(b)
345
345
  ))
346
346
  c.push(...w(m[d], l));
347
347
  return L(
@@ -358,8 +358,8 @@ const J = "sort-svelte-attributes", fe = O({
358
358
  }
359
359
  });
360
360
  let A = (t) => t.replaceAll(/\s\s+/g, " ").trim();
361
- const q = "sort-array-includes", ye = O({
362
- name: q,
361
+ const K = "sort-array-includes", me = I({
362
+ name: K,
363
363
  meta: {
364
364
  type: "suggestion",
365
365
  docs: {
@@ -380,8 +380,8 @@ const q = "sort-array-includes", ye = O({
380
380
  type: "string"
381
381
  },
382
382
  order: {
383
- enum: [g.asc, g.desc],
384
- default: g.asc,
383
+ enum: [f.asc, f.desc],
384
+ default: f.asc,
385
385
  type: "string"
386
386
  },
387
387
  "ignore-case": {
@@ -403,7 +403,7 @@ const q = "sort-array-includes", ye = O({
403
403
  defaultOptions: [
404
404
  {
405
405
  type: p.alphabetical,
406
- order: g.asc
406
+ order: f.asc
407
407
  }
408
408
  ],
409
409
  create: (t) => ({
@@ -411,23 +411,23 @@ const q = "sort-array-includes", ye = O({
411
411
  if ((n.object.type === "ArrayExpression" || n.object.type === "NewExpression") && n.property.type === "Identifier" && n.property.name === "includes") {
412
412
  let s = n.object.type === "ArrayExpression" ? n.object.elements : n.object.arguments;
413
413
  if (s.length > 1) {
414
- let l = j(t.options.at(0), {
414
+ let l = k(t.options.at(0), {
415
415
  type: p.alphabetical,
416
- order: g.asc,
416
+ order: f.asc,
417
417
  "ignore-case": !1,
418
418
  "spread-last": !1
419
419
  }), r = s.reduce(
420
420
  (e, a) => (a !== null && e.at(0).push({
421
421
  name: a.type === "Literal" ? `${a.value}` : t.sourceCode.text.slice(...a.range),
422
- size: v(a.range),
422
+ size: O(a.range),
423
423
  type: a.type,
424
424
  node: a
425
425
  }), e),
426
426
  [[], []]
427
427
  ).flat();
428
- k(r, (e, a) => {
428
+ P(r, (e, a) => {
429
429
  let i;
430
- l["spread-last"] && e.node.type === "Literal" && a.node.type === "SpreadElement" ? i = !1 : l["spread-last"] && e.node.type === "SpreadElement" && a.node.type === "Literal" ? i = !0 : i = I(S(e, a, l)), i && t.report({
430
+ l["spread-last"] && e.node.type === "Literal" && a.node.type === "SpreadElement" ? i = !1 : l["spread-last"] && e.node.type === "SpreadElement" && a.node.type === "Literal" ? i = !0 : i = j(v(e, a, l)), i && t.report({
431
431
  messageId: "unexpectedArrayIncludesOrder",
432
432
  data: {
433
433
  left: A(e.name),
@@ -452,8 +452,8 @@ const q = "sort-array-includes", ye = O({
452
452
  }
453
453
  }
454
454
  })
455
- }), K = "sort-vue-attributes", me = O({
456
- name: K,
455
+ }), H = "sort-vue-attributes", he = I({
456
+ name: H,
457
457
  meta: {
458
458
  type: "suggestion",
459
459
  docs: {
@@ -477,8 +477,8 @@ const q = "sort-array-includes", ye = O({
477
477
  type: "string"
478
478
  },
479
479
  order: {
480
- enum: [g.asc, g.desc],
481
- default: g.asc,
480
+ enum: [f.asc, f.desc],
481
+ default: f.asc,
482
482
  type: "string"
483
483
  },
484
484
  "ignore-case": {
@@ -500,11 +500,11 @@ const q = "sort-array-includes", ye = O({
500
500
  defaultOptions: [
501
501
  {
502
502
  type: p.alphabetical,
503
- order: g.asc
503
+ order: f.asc
504
504
  }
505
505
  ],
506
506
  create: (t) => {
507
- if (B.extname(t.filename) !== ".vue")
507
+ if (_.extname(t.filename) !== ".vue")
508
508
  return {};
509
509
  if (!("defineTemplateBodyVisitor" in t.sourceCode.parserServices))
510
510
  return {};
@@ -512,9 +512,9 @@ const q = "sort-array-includes", ye = O({
512
512
  return n({
513
513
  VStartTag: (s) => {
514
514
  if (s.attributes.length > 1) {
515
- let l = j(t.options.at(0), {
515
+ let l = k(t.options.at(0), {
516
516
  type: p.alphabetical,
517
- order: g.asc,
517
+ order: f.asc,
518
518
  "ignore-case": !1,
519
519
  "custom-groups": {},
520
520
  groups: []
@@ -522,11 +522,11 @@ const q = "sort-array-includes", ye = O({
522
522
  (e, a) => {
523
523
  if (a.key.type === "VDirectiveKey" && a.key.name.rawName === "bind")
524
524
  return e.push([]), e;
525
- let i, { getGroup: o, defineGroup: u, setCustomGroups: y } = G(
525
+ let i, { getGroup: o, defineGroup: u, setCustomGroups: y } = M(
526
526
  l.groups
527
527
  );
528
528
  return typeof a.key.name == "string" && a.key.type !== "VDirectiveKey" ? i = a.key.rawName : i = t.sourceCode.text.slice(...a.key.range), y(l["custom-groups"], i), a.value === null && u("shorthand"), a.loc.start.line !== a.loc.end.line && u("multiline"), e.at(-1).push({
529
- size: v(a.range),
529
+ size: O(a.range),
530
530
  node: a,
531
531
  group: o(),
532
532
  name: i
@@ -535,9 +535,9 @@ const q = "sort-array-includes", ye = O({
535
535
  [[]]
536
536
  );
537
537
  for (let e of r)
538
- k(e, (a, i) => {
539
- let o = x(l.groups, a), u = x(l.groups, i);
540
- (o > u || o === u && I(S(a, i, l))) && t.report({
538
+ P(e, (a, i) => {
539
+ let o = E(l.groups, a), u = E(l.groups, i);
540
+ (o > u || o === u && j(v(a, i, l))) && t.report({
541
541
  messageId: "unexpectedVueAttributesOrder",
542
542
  data: {
543
543
  left: a.name,
@@ -547,15 +547,15 @@ const q = "sort-array-includes", ye = O({
547
547
  fix: (y) => {
548
548
  let m = {};
549
549
  for (let d of e) {
550
- let f = x(l.groups, d);
551
- f in m ? m[f] = w(
552
- [...m[f], d],
550
+ let g = E(l.groups, d);
551
+ g in m ? m[g] = w(
552
+ [...m[g], d],
553
553
  l
554
- ) : m[f] = [d];
554
+ ) : m[g] = [d];
555
555
  }
556
556
  let c = [];
557
557
  for (let d of Object.keys(m).sort(
558
- (f, b) => Number(f) - Number(b)
558
+ (g, b) => Number(g) - Number(b)
559
559
  ))
560
560
  c.push(...w(m[d], l));
561
561
  return L(
@@ -571,8 +571,8 @@ const q = "sort-array-includes", ye = O({
571
571
  }
572
572
  });
573
573
  }
574
- }), H = "sort-named-exports", he = O({
575
- name: H,
574
+ }), Q = "sort-named-exports", be = I({
575
+ name: Q,
576
576
  meta: {
577
577
  type: "suggestion",
578
578
  docs: {
@@ -593,8 +593,8 @@ const q = "sort-array-includes", ye = O({
593
593
  type: "string"
594
594
  },
595
595
  order: {
596
- enum: [g.asc, g.desc],
597
- default: g.asc,
596
+ enum: [f.asc, f.desc],
597
+ default: f.asc,
598
598
  type: "string"
599
599
  },
600
600
  "ignore-case": {
@@ -612,23 +612,23 @@ const q = "sort-array-includes", ye = O({
612
612
  defaultOptions: [
613
613
  {
614
614
  type: p.alphabetical,
615
- order: g.asc
615
+ order: f.asc
616
616
  }
617
617
  ],
618
618
  create: (t) => ({
619
619
  ExportNamedDeclaration: (n) => {
620
620
  if (n.specifiers.length > 1) {
621
- let s = j(t.options.at(0), {
621
+ let s = k(t.options.at(0), {
622
622
  type: p.alphabetical,
623
623
  "ignore-case": !1,
624
- order: g.asc
624
+ order: f.asc
625
625
  }), l = n.specifiers.map((r) => ({
626
- size: v(r.range),
626
+ size: O(r.range),
627
627
  name: r.local.name,
628
628
  node: r
629
629
  }));
630
- k(l, (r, e) => {
631
- I(S(r, e, s)) && t.report({
630
+ P(l, (r, e) => {
631
+ j(v(r, e, s)) && t.report({
632
632
  messageId: "unexpectedNamedExportsOrder",
633
633
  data: {
634
634
  left: r.name,
@@ -646,8 +646,8 @@ const q = "sort-array-includes", ye = O({
646
646
  }
647
647
  }
648
648
  })
649
- }), Q = "sort-named-imports", be = O({
650
- name: Q,
649
+ }), Y = "sort-named-imports", xe = I({
650
+ name: Y,
651
651
  meta: {
652
652
  type: "suggestion",
653
653
  docs: {
@@ -668,8 +668,8 @@ const q = "sort-array-includes", ye = O({
668
668
  type: "string"
669
669
  },
670
670
  order: {
671
- enum: [g.asc, g.desc],
672
- default: g.asc,
671
+ enum: [f.asc, f.desc],
672
+ default: f.asc,
673
673
  type: "string"
674
674
  },
675
675
  "ignore-case": {
@@ -691,7 +691,7 @@ const q = "sort-array-includes", ye = O({
691
691
  defaultOptions: [
692
692
  {
693
693
  type: p.alphabetical,
694
- order: g.asc
694
+ order: f.asc
695
695
  }
696
696
  ],
697
697
  create: (t) => ({
@@ -700,21 +700,21 @@ const q = "sort-array-includes", ye = O({
700
700
  ({ type: l }) => l === "ImportSpecifier"
701
701
  );
702
702
  if (s.length > 1) {
703
- let l = j(t.options.at(0), {
703
+ let l = k(t.options.at(0), {
704
704
  type: p.alphabetical,
705
705
  "ignore-alias": !0,
706
706
  "ignore-case": !1,
707
- order: g.asc
707
+ order: f.asc
708
708
  }), r = s.map((e) => {
709
709
  let { name: a } = e.local;
710
710
  return l["ignore-alias"] && e.type === "ImportSpecifier" && ({ name: a } = e.imported), {
711
- size: v(e.range),
711
+ size: O(e.range),
712
712
  node: e,
713
713
  name: a
714
714
  };
715
715
  });
716
- k(r, (e, a) => {
717
- I(S(e, a, l)) && t.report({
716
+ P(r, (e, a) => {
717
+ j(v(e, a, l)) && t.report({
718
718
  messageId: "unexpectedNamedImportsOrder",
719
719
  data: {
720
720
  left: e.name,
@@ -737,8 +737,8 @@ let z = (t, n, s) => t.lines.slice(
737
737
  n.node.loc.end.line,
738
738
  s.node.loc.start.line - 1
739
739
  ).filter((r) => !r.trim().length).length;
740
- const Y = "sort-object-types", xe = O({
741
- name: Y,
740
+ const Z = "sort-object-types", Ee = I({
741
+ name: Z,
742
742
  meta: {
743
743
  type: "suggestion",
744
744
  docs: {
@@ -762,8 +762,8 @@ const Y = "sort-object-types", xe = O({
762
762
  type: "string"
763
763
  },
764
764
  order: {
765
- enum: [g.asc, g.desc],
766
- default: g.asc,
765
+ enum: [f.asc, f.desc],
766
+ default: f.asc,
767
767
  type: "string"
768
768
  },
769
769
  "ignore-case": {
@@ -789,37 +789,37 @@ const Y = "sort-object-types", xe = O({
789
789
  defaultOptions: [
790
790
  {
791
791
  type: p.alphabetical,
792
- order: g.asc
792
+ order: f.asc
793
793
  }
794
794
  ],
795
795
  create: (t) => ({
796
796
  TSTypeLiteral: (n) => {
797
797
  if (n.members.length > 1) {
798
- let s = j(t.options.at(0), {
798
+ let s = k(t.options.at(0), {
799
799
  "partition-by-new-line": !1,
800
800
  type: p.alphabetical,
801
801
  "ignore-case": !1,
802
- order: g.asc,
802
+ order: f.asc,
803
803
  "custom-groups": {},
804
804
  groups: []
805
805
  }), l = n.members.reduce(
806
806
  (r, e) => {
807
- var E, h, C, N;
807
+ var N, h, C, x;
808
808
  let a, i = t.sourceCode.text.slice(
809
809
  e.range.at(0),
810
810
  e.range.at(1)
811
- ), o = (E = r.at(-1)) == null ? void 0 : E.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: m } = G(
811
+ ), o = (N = r.at(-1)) == null ? void 0 : N.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: m } = M(
812
812
  s.groups
813
- ), c = (P) => P.replace(/(,|;)$/, "");
813
+ ), c = (S) => S.replace(/(,|;)$/, "");
814
814
  if (e.type === "TSPropertySignature")
815
815
  e.key.type === "Identifier" ? { name: a } = e.key : e.key.type === "Literal" ? a = `${e.key.value}` : a = t.sourceCode.text.slice(
816
816
  e.range.at(0),
817
817
  (h = e.typeAnnotation) == null ? void 0 : h.range.at(0)
818
818
  );
819
819
  else if (e.type === "TSIndexSignature") {
820
- let P = ((C = e.typeAnnotation) == null ? void 0 : C.range.at(0)) ?? e.range.at(1);
820
+ let S = ((C = e.typeAnnotation) == null ? void 0 : C.range.at(0)) ?? e.range.at(1);
821
821
  a = c(
822
- t.sourceCode.text.slice(e.range.at(0), P)
822
+ t.sourceCode.text.slice(e.range.at(0), S)
823
823
  );
824
824
  } else
825
825
  a = c(
@@ -829,12 +829,12 @@ const Y = "sort-object-types", xe = O({
829
829
  )
830
830
  );
831
831
  m(s["custom-groups"], a), e.loc.start.line !== e.loc.end.line && y("multiline");
832
- let f = i.endsWith(";") || i.endsWith(",") ? 1 : 0, b = {
833
- size: v(e.range) - f,
832
+ let g = i.endsWith(";") || i.endsWith(",") ? 1 : 0, b = {
833
+ size: O(e.range) - g,
834
834
  node: e,
835
835
  name: a
836
836
  };
837
- return s["partition-by-new-line"] && o && z(t.sourceCode, o, b) && r.push([]), (N = r.at(-1)) == null || N.push({
837
+ return s["partition-by-new-line"] && o && z(t.sourceCode, o, b) && r.push([]), (x = r.at(-1)) == null || x.push({
838
838
  ...b,
839
839
  group: u()
840
840
  }), r;
@@ -842,9 +842,9 @@ const Y = "sort-object-types", xe = O({
842
842
  [[]]
843
843
  );
844
844
  for (let r of l)
845
- k(r, (e, a) => {
846
- let i = x(s.groups, e), o = x(s.groups, a);
847
- (i > o || i === o && I(S(e, a, s))) && t.report({
845
+ P(r, (e, a) => {
846
+ let i = E(s.groups, e), o = E(s.groups, a);
847
+ (i > o || i === o && j(v(e, a, s))) && t.report({
848
848
  messageId: "unexpectedObjectTypesOrder",
849
849
  data: {
850
850
  left: A(e.name),
@@ -854,7 +854,7 @@ const Y = "sort-object-types", xe = O({
854
854
  fix: (u) => {
855
855
  let y = {};
856
856
  for (let c of r) {
857
- let d = x(s.groups, c);
857
+ let d = E(s.groups, c);
858
858
  d in y ? y[d] = w(
859
859
  [...y[d], c],
860
860
  s
@@ -862,7 +862,7 @@ const Y = "sort-object-types", xe = O({
862
862
  }
863
863
  let m = [];
864
864
  for (let c of Object.keys(y).sort(
865
- (d, f) => Number(d) - Number(f)
865
+ (d, g) => Number(d) - Number(g)
866
866
  ))
867
867
  m.push(...w(y[c], s));
868
868
  return L(
@@ -877,8 +877,8 @@ const Y = "sort-object-types", xe = O({
877
877
  }
878
878
  }
879
879
  })
880
- }), Z = "sort-union-types", Ee = O({
881
- name: Z,
880
+ }), F = "sort-union-types", Ce = I({
881
+ name: F,
882
882
  meta: {
883
883
  type: "suggestion",
884
884
  docs: {
@@ -899,8 +899,8 @@ const Y = "sort-object-types", xe = O({
899
899
  type: "string"
900
900
  },
901
901
  order: {
902
- enum: [g.asc, g.desc],
903
- default: g.asc,
902
+ enum: [f.asc, f.desc],
903
+ default: f.asc,
904
904
  type: "string"
905
905
  },
906
906
  "ignore-case": {
@@ -922,24 +922,24 @@ const Y = "sort-object-types", xe = O({
922
922
  defaultOptions: [
923
923
  {
924
924
  type: p.alphabetical,
925
- order: g.asc
925
+ order: f.asc
926
926
  }
927
927
  ],
928
928
  create: (t) => ({
929
929
  TSUnionType: (n) => {
930
- let s = j(t.options.at(0), {
930
+ let s = k(t.options.at(0), {
931
931
  type: p.alphabetical,
932
932
  "nullable-last": !1,
933
933
  "ignore-case": !1,
934
- order: g.asc
934
+ order: f.asc
935
935
  }), l = n.types.map((r) => ({
936
936
  group: r.type === "TSNullKeyword" || r.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
937
937
  name: t.sourceCode.text.slice(...r.range),
938
- size: v(r.range),
938
+ size: O(r.range),
939
939
  node: r
940
940
  }));
941
- k(l, (r, e) => {
942
- let a = I(S(r, e, s));
941
+ P(l, (r, e) => {
942
+ let a = j(v(r, e, s));
943
943
  s["nullable-last"] && (r.group === "nullable" && e.group === "unknown" ? a = !0 : r.group === "unknown" && e.group === "nullable" && (a = !1)), a && t.report({
944
944
  messageId: "unexpectedUnionTypesOrder",
945
945
  data: {
@@ -963,8 +963,8 @@ const Y = "sort-object-types", xe = O({
963
963
  });
964
964
  }
965
965
  })
966
- }), F = "sort-interfaces", Ce = O({
967
- name: F,
966
+ }), ee = "sort-interfaces", Ne = I({
967
+ name: ee,
968
968
  meta: {
969
969
  type: "suggestion",
970
970
  docs: {
@@ -988,8 +988,8 @@ const Y = "sort-object-types", xe = O({
988
988
  type: "string"
989
989
  },
990
990
  order: {
991
- enum: [g.asc, g.desc],
992
- default: g.asc,
991
+ enum: [f.asc, f.desc],
992
+ default: f.asc,
993
993
  type: "string"
994
994
  },
995
995
  "ignore-case": {
@@ -1021,17 +1021,17 @@ const Y = "sort-object-types", xe = O({
1021
1021
  defaultOptions: [
1022
1022
  {
1023
1023
  type: p.alphabetical,
1024
- order: g.asc
1024
+ order: f.asc
1025
1025
  }
1026
1026
  ],
1027
1027
  create: (t) => ({
1028
1028
  TSInterfaceDeclaration: (n) => {
1029
1029
  if (n.body.body.length > 1) {
1030
- let s = j(t.options.at(0), {
1030
+ let s = k(t.options.at(0), {
1031
1031
  "partition-by-new-line": !1,
1032
1032
  type: p.alphabetical,
1033
1033
  "ignore-case": !1,
1034
- order: g.asc,
1034
+ order: f.asc,
1035
1035
  "ignore-pattern": [],
1036
1036
  "custom-groups": {},
1037
1037
  groups: []
@@ -1043,10 +1043,10 @@ const Y = "sort-object-types", xe = O({
1043
1043
  )) {
1044
1044
  let l = n.body.body.reduce(
1045
1045
  (r, e) => {
1046
- var c, d, f, b;
1046
+ var c, d, g, b;
1047
1047
  if (e.type === "TSCallSignatureDeclaration")
1048
1048
  return r.push([]), r;
1049
- let a = (c = r.at(-1)) == null ? void 0 : c.at(-1), i, { getGroup: o, defineGroup: u, setCustomGroups: y } = G(
1049
+ let a = (c = r.at(-1)) == null ? void 0 : c.at(-1), i, { getGroup: o, defineGroup: u, setCustomGroups: y } = M(
1050
1050
  s.groups
1051
1051
  );
1052
1052
  if (e.type === "TSPropertySignature")
@@ -1055,24 +1055,24 @@ const Y = "sort-object-types", xe = O({
1055
1055
  else if (e.key.type === "Literal")
1056
1056
  i = `${e.key.value}`;
1057
1057
  else {
1058
- let E = ((d = e.typeAnnotation) == null ? void 0 : d.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
1059
- i = t.sourceCode.text.slice(e.range.at(0), E);
1058
+ let N = ((d = e.typeAnnotation) == null ? void 0 : d.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
1059
+ i = t.sourceCode.text.slice(e.range.at(0), N);
1060
1060
  }
1061
1061
  else if (e.type === "TSIndexSignature") {
1062
- let E = ((f = e.typeAnnotation) == null ? void 0 : f.range.at(0)) ?? e.range.at(1);
1062
+ let N = ((g = e.typeAnnotation) == null ? void 0 : g.range.at(0)) ?? e.range.at(1);
1063
1063
  i = t.sourceCode.text.slice(
1064
1064
  e.range.at(0),
1065
- E
1065
+ N
1066
1066
  );
1067
1067
  } else {
1068
- let E = ((b = e.returnType) == null ? void 0 : b.range.at(0)) ?? e.range.at(1);
1068
+ let N = ((b = e.returnType) == null ? void 0 : b.range.at(0)) ?? e.range.at(1);
1069
1069
  i = t.sourceCode.text.slice(
1070
1070
  e.range.at(0),
1071
- E
1071
+ N
1072
1072
  );
1073
1073
  }
1074
1074
  let m = {
1075
- size: v(e.range),
1075
+ size: O(e.range),
1076
1076
  node: e,
1077
1077
  name: i
1078
1078
  };
@@ -1088,9 +1088,9 @@ const Y = "sort-object-types", xe = O({
1088
1088
  [[]]
1089
1089
  );
1090
1090
  for (let r of l)
1091
- k(r, (e, a) => {
1092
- let i = x(s.groups, e), o = x(s.groups, a);
1093
- (i > o || i === o && I(S(e, a, s))) && t.report({
1091
+ P(r, (e, a) => {
1092
+ let i = E(s.groups, e), o = E(s.groups, a);
1093
+ (i > o || i === o && j(v(e, a, s))) && t.report({
1094
1094
  messageId: "unexpectedInterfacePropertiesOrder",
1095
1095
  data: {
1096
1096
  left: A(e.name),
@@ -1100,7 +1100,7 @@ const Y = "sort-object-types", xe = O({
1100
1100
  fix: (u) => {
1101
1101
  let y = {};
1102
1102
  for (let c of r) {
1103
- let d = x(s.groups, c);
1103
+ let d = E(s.groups, c);
1104
1104
  d in y ? y[d] = w(
1105
1105
  [...y[d], c],
1106
1106
  s
@@ -1108,7 +1108,7 @@ const Y = "sort-object-types", xe = O({
1108
1108
  }
1109
1109
  let m = [];
1110
1110
  for (let c of Object.keys(y).sort(
1111
- (d, f) => Number(d) - Number(f)
1111
+ (d, g) => Number(d) - Number(g)
1112
1112
  ))
1113
1113
  m.push(...w(y[c], s));
1114
1114
  return L(
@@ -1124,8 +1124,8 @@ const Y = "sort-object-types", xe = O({
1124
1124
  }
1125
1125
  }
1126
1126
  })
1127
- }), ee = "sort-jsx-props", Ne = O({
1128
- name: ee,
1127
+ }), te = "sort-jsx-props", we = I({
1128
+ name: te,
1129
1129
  meta: {
1130
1130
  type: "suggestion",
1131
1131
  docs: {
@@ -1149,8 +1149,8 @@ const Y = "sort-object-types", xe = O({
1149
1149
  type: "string"
1150
1150
  },
1151
1151
  order: {
1152
- enum: [g.asc, g.desc],
1153
- default: g.asc,
1152
+ enum: [f.asc, f.desc],
1153
+ default: f.asc,
1154
1154
  type: "string"
1155
1155
  },
1156
1156
  groups: {
@@ -1171,28 +1171,28 @@ const Y = "sort-object-types", xe = O({
1171
1171
  defaultOptions: [
1172
1172
  {
1173
1173
  type: p.alphabetical,
1174
- order: g.asc
1174
+ order: f.asc
1175
1175
  }
1176
1176
  ],
1177
- create: (t) => [".svelte", ".astro", ".vue"].includes(B.extname(t.filename)) ? {} : {
1177
+ create: (t) => [".svelte", ".astro", ".vue"].includes(_.extname(t.filename)) ? {} : {
1178
1178
  JSXElement: (n) => {
1179
1179
  if (n.openingElement.attributes.length > 1) {
1180
- let s = j(t.options.at(0), {
1180
+ let s = k(t.options.at(0), {
1181
1181
  type: p.alphabetical,
1182
1182
  "ignore-case": !1,
1183
- order: g.asc,
1183
+ order: f.asc,
1184
1184
  "custom-groups": {},
1185
1185
  groups: []
1186
1186
  }), l = n.openingElement.attributes.reduce(
1187
1187
  (r, e) => {
1188
1188
  if (e.type === "JSXSpreadAttribute")
1189
1189
  return r.push([]), r;
1190
- let a = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: i, defineGroup: o, setCustomGroups: u } = G(
1190
+ let a = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: i, defineGroup: o, setCustomGroups: u } = M(
1191
1191
  s.groups
1192
1192
  );
1193
1193
  u(s["custom-groups"], a), e.value === null && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline");
1194
1194
  let y = {
1195
- size: v(e.range),
1195
+ size: O(e.range),
1196
1196
  group: i(),
1197
1197
  node: e,
1198
1198
  name: a
@@ -1202,9 +1202,9 @@ const Y = "sort-object-types", xe = O({
1202
1202
  [[]]
1203
1203
  );
1204
1204
  for (let r of l)
1205
- k(r, (e, a) => {
1206
- let i = x(s.groups, e), o = x(s.groups, a);
1207
- (i > o || i === o && I(S(e, a, s))) && t.report({
1205
+ P(r, (e, a) => {
1206
+ let i = E(s.groups, e), o = E(s.groups, a);
1207
+ (i > o || i === o && j(v(e, a, s))) && t.report({
1208
1208
  messageId: "unexpectedJSXPropsOrder",
1209
1209
  data: {
1210
1210
  left: e.name,
@@ -1214,7 +1214,7 @@ const Y = "sort-object-types", xe = O({
1214
1214
  fix: (u) => {
1215
1215
  let y = {};
1216
1216
  for (let c of r) {
1217
- let d = x(s.groups, c);
1217
+ let d = E(s.groups, c);
1218
1218
  d in y ? y[d] = w(
1219
1219
  [...y[d], c],
1220
1220
  s
@@ -1222,7 +1222,7 @@ const Y = "sort-object-types", xe = O({
1222
1222
  }
1223
1223
  let m = [];
1224
1224
  for (let c of Object.keys(y).sort(
1225
- (d, f) => Number(d) - Number(f)
1225
+ (d, g) => Number(d) - Number(g)
1226
1226
  ))
1227
1227
  m.push(...w(y[c], s));
1228
1228
  return L(
@@ -1237,8 +1237,8 @@ const Y = "sort-object-types", xe = O({
1237
1237
  }
1238
1238
  }
1239
1239
  }
1240
- }), te = "sort-exports", we = O({
1241
- name: te,
1240
+ }), re = "sort-exports", Se = I({
1241
+ name: re,
1242
1242
  meta: {
1243
1243
  type: "suggestion",
1244
1244
  docs: {
@@ -1259,8 +1259,8 @@ const Y = "sort-object-types", xe = O({
1259
1259
  type: "string"
1260
1260
  },
1261
1261
  order: {
1262
- enum: [g.asc, g.desc],
1263
- default: g.asc,
1262
+ enum: [f.asc, f.desc],
1263
+ default: f.asc,
1264
1264
  type: "string"
1265
1265
  },
1266
1266
  "ignore-case": {
@@ -1278,17 +1278,17 @@ const Y = "sort-object-types", xe = O({
1278
1278
  defaultOptions: [
1279
1279
  {
1280
1280
  type: p.alphabetical,
1281
- order: g.asc
1281
+ order: f.asc
1282
1282
  }
1283
1283
  ],
1284
1284
  create: (t) => {
1285
- let n = j(t.options.at(0), {
1285
+ let n = k(t.options.at(0), {
1286
1286
  type: p.alphabetical,
1287
- order: g.asc,
1287
+ order: f.asc,
1288
1288
  "ignore-case": !1
1289
1289
  }), s = [[]], l = (r) => {
1290
1290
  r.type === "ExportAllDeclaration" && r.exported === null ? s.push([]) : s.at(-1).push({
1291
- size: v(r.range),
1291
+ size: O(r.range),
1292
1292
  name: r.source.value,
1293
1293
  node: r
1294
1294
  });
@@ -1300,8 +1300,8 @@ const Y = "sort-object-types", xe = O({
1300
1300
  },
1301
1301
  "Program:exit": () => {
1302
1302
  for (let r of s)
1303
- k(r, (e, a) => {
1304
- I(S(e, a, n)) && t.report({
1303
+ P(r, (e, a) => {
1304
+ j(v(e, a, n)) && t.report({
1305
1305
  messageId: "unexpectedExportsOrder",
1306
1306
  data: {
1307
1307
  left: e.name,
@@ -1319,8 +1319,8 @@ const Y = "sort-object-types", xe = O({
1319
1319
  }
1320
1320
  };
1321
1321
  }
1322
- }), re = "sort-imports", Se = O({
1323
- name: re,
1322
+ }), se = "sort-imports", ve = I({
1323
+ name: se,
1324
1324
  meta: {
1325
1325
  type: "suggestion",
1326
1326
  docs: {
@@ -1354,8 +1354,8 @@ const Y = "sort-object-types", xe = O({
1354
1354
  type: "string"
1355
1355
  },
1356
1356
  order: {
1357
- enum: [g.asc, g.desc],
1358
- default: g.asc,
1357
+ enum: [f.asc, f.desc],
1358
+ default: f.asc,
1359
1359
  type: "string"
1360
1360
  },
1361
1361
  "ignore-case": {
@@ -1424,16 +1424,16 @@ const Y = "sort-object-types", xe = O({
1424
1424
  defaultOptions: [
1425
1425
  {
1426
1426
  type: p.alphabetical,
1427
- order: g.asc
1427
+ order: f.asc
1428
1428
  }
1429
1429
  ],
1430
1430
  create: (t) => {
1431
- let n = j(t.options.at(0), {
1431
+ let n = k(t.options.at(0), {
1432
1432
  "newlines-between": "always",
1433
1433
  "custom-groups": { type: {}, value: {} },
1434
1434
  "internal-pattern": ["~/**"],
1435
1435
  type: p.alphabetical,
1436
- order: g.asc,
1436
+ order: f.asc,
1437
1437
  "ignore-case": !1,
1438
1438
  groups: []
1439
1439
  }), s = !1;
@@ -1445,9 +1445,9 @@ const Y = "sort-object-types", xe = O({
1445
1445
  o === "unknown" && (s = !0);
1446
1446
  s || (n.groups = [...n.groups, "unknown"]);
1447
1447
  let l = [], r = (o) => o.type === "ImportDeclaration" && o.specifiers.length === 0, e = (o) => {
1448
- let u = (N) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1449
- (P) => N.endsWith(P)
1450
- ), y = (N) => [
1448
+ let u = (x) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1449
+ (S) => x.endsWith(S)
1450
+ ), y = (x) => [
1451
1451
  "./index.d.js",
1452
1452
  "./index.d.ts",
1453
1453
  "./index.js",
@@ -1455,12 +1455,12 @@ const Y = "sort-object-types", xe = O({
1455
1455
  "./index",
1456
1456
  "./",
1457
1457
  "."
1458
- ].includes(N), m = (N) => N.indexOf("..") === 0, c = (N) => N.indexOf("./") === 0, { getGroup: d, defineGroup: f, setCustomGroups: b } = G(n.groups), E = (N) => n["internal-pattern"].length && n["internal-pattern"].some(
1459
- (P) => $(N.source.value, P, {
1458
+ ].includes(x), m = (x) => x.indexOf("..") === 0, c = (x) => x.indexOf("./") === 0, { getGroup: d, defineGroup: g, setCustomGroups: b } = M(n.groups), N = (x) => n["internal-pattern"].length && n["internal-pattern"].some(
1459
+ (S) => $(x.source.value, S, {
1460
1460
  nocomment: !0
1461
1461
  })
1462
- ), h = (N) => {
1463
- let P = [
1462
+ ), h = (x) => {
1463
+ let S = [
1464
1464
  "bun",
1465
1465
  "bun:ffi",
1466
1466
  "bun:jsc",
@@ -1471,15 +1471,15 @@ const Y = "sort-object-types", xe = O({
1471
1471
  "undici",
1472
1472
  "ws"
1473
1473
  ];
1474
- return de.includes(
1475
- N.startsWith("node:") ? N.split("node:")[1] : N
1476
- ) || P.includes(N);
1477
- }, C = (N) => !(N.startsWith(".") || N.startsWith("/"));
1478
- return o.importKind === "type" && (o.type === "ImportDeclaration" && (b(n["custom-groups"].type, o.source.value), y(o.source.value) && f("index-type"), c(o.source.value) && f("sibling-type"), m(o.source.value) && f("parent-type"), E(o) && f("internal-type"), h(o.source.value) && f("builtin-type"), C(o.source.value) && f("external-type")), f("type")), o.type === "ImportDeclaration" && (b(n["custom-groups"].value, o.source.value), r(o) && u(o.source.value) && f("side-effect-style"), r(o) && f("side-effect"), u(o.source.value) && f("style"), y(o.source.value) && f("index"), c(o.source.value) && f("sibling"), m(o.source.value) && f("parent"), E(o) && f("internal"), h(o.source.value) && f("builtin"), C(o.source.value) && f("external")), d();
1474
+ return ce.includes(
1475
+ x.startsWith("node:") ? x.split("node:")[1] : x
1476
+ ) || S.includes(x);
1477
+ }, C = (x) => !(x.startsWith(".") || x.startsWith("/"));
1478
+ return o.importKind === "type" && (o.type === "ImportDeclaration" && (b(n["custom-groups"].type, o.source.value), y(o.source.value) && g("index-type"), c(o.source.value) && g("sibling-type"), m(o.source.value) && g("parent-type"), N(o) && g("internal-type"), h(o.source.value) && g("builtin-type"), C(o.source.value) && g("external-type")), g("type")), o.type === "ImportDeclaration" && (b(n["custom-groups"].value, o.source.value), r(o) && u(o.source.value) && g("side-effect-style"), r(o) && g("side-effect"), u(o.source.value) && g("style"), y(o.source.value) && g("index"), c(o.source.value) && g("sibling"), m(o.source.value) && g("parent"), N(o) && g("internal"), h(o.source.value) && g("builtin"), C(o.source.value) && g("external")), d();
1479
1479
  }, a = (o) => o.specifiers.length > 1, i = (o) => {
1480
1480
  let u;
1481
1481
  o.type === "ImportDeclaration" ? u = o.source.value : o.moduleReference.type === "TSExternalModuleReference" && o.moduleReference.expression.type === "Literal" ? u = `${o.moduleReference.expression.value}` : u = t.sourceCode.text.slice(...o.moduleReference.range), l.push({
1482
- size: v(o.range),
1482
+ size: O(o.range),
1483
1483
  group: e(o),
1484
1484
  name: u,
1485
1485
  node: o,
@@ -1497,44 +1497,44 @@ const Y = "sort-object-types", xe = O({
1497
1497
  var m;
1498
1498
  let o = (c, d) => !!t.sourceCode.getTokensBetween(
1499
1499
  c.node,
1500
- V(d.node, t.sourceCode) || d.node,
1500
+ J(d.node, t.sourceCode) || d.node,
1501
1501
  {
1502
1502
  includeComments: !0
1503
1503
  }
1504
1504
  ).length, u = (c, d) => {
1505
- let f = [], b = {};
1505
+ let g = [], b = {};
1506
1506
  for (let h of d) {
1507
- let C = x(n.groups, h);
1507
+ let C = E(n.groups, h);
1508
1508
  C in b ? b[C] = w(
1509
1509
  [...b[C], h],
1510
1510
  n
1511
1511
  ) : b[C] = [h];
1512
1512
  }
1513
- let E = Object.keys(b).sort((h, C) => Number(h) - Number(C)).reduce(
1513
+ let N = Object.keys(b).sort((h, C) => Number(h) - Number(C)).reduce(
1514
1514
  (h, C) => [
1515
1515
  ...h,
1516
1516
  ...b[C]
1517
1517
  ],
1518
1518
  []
1519
1519
  );
1520
- for (let h = 0, C = E.length; h < C; h++) {
1521
- let N = E.at(h);
1522
- if (f.push(
1520
+ for (let h = 0, C = N.length; h < C; h++) {
1521
+ let x = N.at(h);
1522
+ if (g.push(
1523
1523
  c.replaceTextRange(
1524
1524
  T(d.at(h).node, t.sourceCode),
1525
1525
  t.sourceCode.text.slice(
1526
- ...T(N.node, t.sourceCode)
1526
+ ...T(x.node, t.sourceCode)
1527
1527
  )
1528
1528
  )
1529
1529
  ), n["newlines-between"] !== "ignore") {
1530
- let P = E.at(h + 1);
1531
- if (P) {
1532
- let M = z(
1530
+ let S = N.at(h + 1);
1531
+ if (S) {
1532
+ let G = z(
1533
1533
  t.sourceCode,
1534
1534
  d.at(h),
1535
1535
  d.at(h + 1)
1536
1536
  );
1537
- (n["newlines-between"] === "always" && x(n.groups, N) === x(n.groups, P) && M !== 0 || n["newlines-between"] === "never" && M > 0) && f.push(
1537
+ (n["newlines-between"] === "always" && E(n.groups, x) === E(n.groups, S) && G !== 0 || n["newlines-between"] === "never" && G > 0) && g.push(
1538
1538
  c.removeRange([
1539
1539
  T(
1540
1540
  d.at(h).node,
@@ -1545,7 +1545,7 @@ const Y = "sort-object-types", xe = O({
1545
1545
  t.sourceCode
1546
1546
  ).at(0) - 1
1547
1547
  ])
1548
- ), n["newlines-between"] === "always" && x(n.groups, N) !== x(n.groups, P) && M > 1 && f.push(
1548
+ ), n["newlines-between"] === "always" && E(n.groups, x) !== E(n.groups, S) && G > 1 && g.push(
1549
1549
  c.replaceTextRange(
1550
1550
  [
1551
1551
  T(
@@ -1560,7 +1560,7 @@ const Y = "sort-object-types", xe = O({
1560
1560
  `
1561
1561
  `
1562
1562
  )
1563
- ), n["newlines-between"] === "always" && x(n.groups, N) !== x(n.groups, P) && M === 0 && f.push(
1563
+ ), n["newlines-between"] === "always" && E(n.groups, x) !== E(n.groups, S) && G === 0 && g.push(
1564
1564
  c.insertTextAfterRange(
1565
1565
  T(d.at(h).node, t.sourceCode),
1566
1566
  `
@@ -1570,58 +1570,58 @@ const Y = "sort-object-types", xe = O({
1570
1570
  }
1571
1571
  }
1572
1572
  }
1573
- return f;
1573
+ return g;
1574
1574
  }, y = [[]];
1575
1575
  for (let c of l) {
1576
1576
  let d = (m = y.at(-1)) == null ? void 0 : m.at(-1);
1577
1577
  d && o(d, c) ? y.push([c]) : y.at(-1).push(c);
1578
1578
  }
1579
1579
  for (let c of y)
1580
- k(c, (d, f) => {
1581
- let b = x(n.groups, d), E = x(n.groups, f), h = z(
1580
+ P(c, (d, g) => {
1581
+ let b = E(n.groups, d), N = E(n.groups, g), h = z(
1582
1582
  t.sourceCode,
1583
1583
  d,
1584
- f
1584
+ g
1585
1585
  );
1586
- !(r(d.node) && r(f.node)) && !o(d, f) && (b > E || b === E && I(S(d, f, n))) && t.report({
1586
+ !(r(d.node) && r(g.node)) && !o(d, g) && (b > N || b === N && j(v(d, g, n))) && t.report({
1587
1587
  messageId: "unexpectedImportsOrder",
1588
1588
  data: {
1589
1589
  left: d.name,
1590
- right: f.name
1590
+ right: g.name
1591
1591
  },
1592
- node: f.node,
1592
+ node: g.node,
1593
1593
  fix: (C) => u(C, c)
1594
1594
  }), n["newlines-between"] === "never" && h > 0 && t.report({
1595
1595
  messageId: "extraSpacingBetweenImports",
1596
1596
  data: {
1597
1597
  left: d.name,
1598
- right: f.name
1598
+ right: g.name
1599
1599
  },
1600
- node: f.node,
1600
+ node: g.node,
1601
1601
  fix: (C) => u(C, c)
1602
- }), n["newlines-between"] === "always" && (b < E && h === 0 ? t.report({
1602
+ }), n["newlines-between"] === "always" && (b < N && h === 0 ? t.report({
1603
1603
  messageId: "missedSpacingBetweenImports",
1604
1604
  data: {
1605
1605
  left: d.name,
1606
- right: f.name
1606
+ right: g.name
1607
1607
  },
1608
- node: f.node,
1608
+ node: g.node,
1609
1609
  fix: (C) => u(C, c)
1610
- }) : (h > 1 || b === E && h > 0) && t.report({
1610
+ }) : (h > 1 || b === N && h > 0) && t.report({
1611
1611
  messageId: "extraSpacingBetweenImports",
1612
1612
  data: {
1613
1613
  left: d.name,
1614
- right: f.name
1614
+ right: g.name
1615
1615
  },
1616
- node: f.node,
1616
+ node: g.node,
1617
1617
  fix: (C) => u(C, c)
1618
1618
  }));
1619
1619
  });
1620
1620
  }
1621
1621
  };
1622
1622
  }
1623
- }), se = "sort-objects", Ae = O({
1624
- name: se,
1623
+ }), ae = "sort-objects", Ae = I({
1624
+ name: ae,
1625
1625
  meta: {
1626
1626
  type: "suggestion",
1627
1627
  docs: {
@@ -1657,14 +1657,20 @@ const Y = "sort-object-types", xe = O({
1657
1657
  type: "string"
1658
1658
  },
1659
1659
  order: {
1660
- enum: [g.asc, g.desc],
1661
- default: g.asc,
1660
+ enum: [f.asc, f.desc],
1661
+ default: f.asc,
1662
1662
  type: "string"
1663
1663
  },
1664
1664
  "ignore-case": {
1665
1665
  type: "boolean",
1666
1666
  default: !1
1667
1667
  },
1668
+ "ignore-pattern": {
1669
+ items: {
1670
+ type: "string"
1671
+ },
1672
+ type: "array"
1673
+ },
1668
1674
  groups: {
1669
1675
  type: "array"
1670
1676
  }
@@ -1679,44 +1685,50 @@ const Y = "sort-object-types", xe = O({
1679
1685
  defaultOptions: [
1680
1686
  {
1681
1687
  type: p.alphabetical,
1682
- order: g.asc
1688
+ order: f.asc
1683
1689
  }
1684
1690
  ],
1685
1691
  create: (t) => {
1686
1692
  let n = (s) => {
1687
- if (s.properties.length > 1) {
1688
- let l = j(t.options.at(0), {
1689
- "partition-by-new-line": !1,
1690
- "partition-by-comment": !1,
1691
- type: p.alphabetical,
1692
- "styled-components": !0,
1693
- "ignore-case": !1,
1694
- order: g.asc,
1695
- "custom-groups": {},
1696
- groups: []
1697
- }), r = (i) => i.type === "Identifier" && i.name === "styled", e = (i) => i !== void 0 && i.type === "CallExpression" && (i.callee.type === "MemberExpression" && r(i.callee.object) || i.callee.type === "CallExpression" && r(i.callee.callee));
1698
- if (!l["styled-components"] && (e(s.parent) || s.parent.type === "ArrowFunctionExpression" && e(s.parent.parent)))
1693
+ let l = k(t.options.at(0), {
1694
+ "partition-by-new-line": !1,
1695
+ "partition-by-comment": !1,
1696
+ type: p.alphabetical,
1697
+ "styled-components": !0,
1698
+ "ignore-case": !1,
1699
+ "ignore-pattern": [],
1700
+ order: f.asc,
1701
+ "custom-groups": {},
1702
+ groups: []
1703
+ }), r = s.parent.type === "VariableDeclarator" && s.parent.id.type === "Identifier" ? s.parent.id.name : null;
1704
+ if (!(l["ignore-pattern"].length && typeof r == "string" ? l["ignore-pattern"].some(
1705
+ (a) => $(r, a, {
1706
+ nocomment: !0
1707
+ })
1708
+ ) : !1) && s.properties.length > 1) {
1709
+ let a = (u) => u.type === "Identifier" && u.name === "styled", i = (u) => u !== void 0 && u.type === "CallExpression" && (u.callee.type === "MemberExpression" && a(u.callee.object) || u.callee.type === "CallExpression" && a(u.callee.callee));
1710
+ if (!l["styled-components"] && (i(s.parent) || s.parent.type === "ArrowFunctionExpression" && i(s.parent.parent)))
1699
1711
  return;
1700
- let a = (i) => i.reduce(
1701
- (o, u) => {
1702
- var N;
1703
- if (u.type === "SpreadElement" || u.type === "RestElement")
1704
- return o.push([]), o;
1705
- let y = V(u, t.sourceCode), m = (N = o.at(-1)) == null ? void 0 : N.at(-1);
1706
- l["partition-by-comment"] && y && ie(
1712
+ let o = (u) => u.reduce(
1713
+ (y, m) => {
1714
+ var G;
1715
+ if (m.type === "SpreadElement" || m.type === "RestElement")
1716
+ return y.push([]), y;
1717
+ let c = J(m, t.sourceCode), d = (G = y.at(-1)) == null ? void 0 : G.at(-1);
1718
+ l["partition-by-comment"] && c && pe(
1707
1719
  l["partition-by-comment"],
1708
- y.value
1709
- ) && o.push([]);
1710
- let c, d = "ignore", f = [], { getGroup: b, setCustomGroups: E } = G(l.groups);
1711
- u.key.type === "Identifier" ? { name: c } = u.key : u.key.type === "Literal" ? c = `${u.key.value}` : c = t.sourceCode.text.slice(...u.key.range);
1712
- let h = {
1713
- size: v(u.range),
1714
- node: u,
1715
- name: c
1720
+ c.value
1721
+ ) && y.push([]);
1722
+ let g, b = "ignore", N = [], { getGroup: h, setCustomGroups: C } = M(l.groups);
1723
+ m.key.type === "Identifier" ? { name: g } = m.key : m.key.type === "Literal" ? g = `${m.key.value}` : g = t.sourceCode.text.slice(...m.key.range);
1724
+ let x = {
1725
+ size: O(m.range),
1726
+ node: m,
1727
+ name: g
1716
1728
  };
1717
- l["partition-by-new-line"] && m && z(t.sourceCode, m, h) && o.push([]), u.value.type === "AssignmentPattern" && ((M) => {
1718
- M.right.type === "Identifier" && f.push(M.right.name);
1719
- let le = (R) => {
1729
+ l["partition-by-new-line"] && d && z(t.sourceCode, d, x) && y.push([]), m.value.type === "AssignmentPattern" && ((B) => {
1730
+ B.right.type === "Identifier" && N.push(B.right.name);
1731
+ let ie = (R) => {
1720
1732
  let D = [];
1721
1733
  switch (R.type) {
1722
1734
  case "ArrowFunctionExpression":
@@ -1734,51 +1746,51 @@ const Y = "sort-object-types", xe = O({
1734
1746
  break;
1735
1747
  }
1736
1748
  D.forEach((U) => {
1737
- U.type === "Identifier" && f.push(U.name), (U.type === "BinaryExpression" || U.type === "ConditionalExpression") && le(U);
1749
+ U.type === "Identifier" && N.push(U.name), (U.type === "BinaryExpression" || U.type === "ConditionalExpression") && ie(U);
1738
1750
  });
1739
1751
  };
1740
- switch (M.right.type) {
1752
+ switch (B.right.type) {
1741
1753
  case "ArrowFunctionExpression":
1742
1754
  case "ConditionalExpression":
1743
1755
  case "LogicalExpression":
1744
1756
  case "BinaryExpression":
1745
1757
  case "CallExpression":
1746
- le(M.right);
1758
+ ie(B.right);
1747
1759
  break;
1748
1760
  }
1749
- })(u.value), E(l["custom-groups"], c);
1750
- let C = {
1751
- ...h,
1752
- group: b(),
1753
- dependencies: f,
1754
- position: d
1761
+ })(m.value), C(l["custom-groups"], g);
1762
+ let S = {
1763
+ ...x,
1764
+ group: h(),
1765
+ dependencies: N,
1766
+ position: b
1755
1767
  };
1756
- return o.at(-1).push(C), o;
1768
+ return y.at(-1).push(S), y;
1757
1769
  },
1758
1770
  [[]]
1759
1771
  );
1760
- for (let i of a(s.properties))
1761
- k(i, (o, u) => {
1762
- let y = x(l.groups, o), m = x(l.groups, u);
1763
- if (y > m || y === m && I(S(o, u, l))) {
1764
- let c = (d) => {
1765
- let f = {};
1766
- for (let E of i) {
1767
- let h = x(l.groups, E);
1768
- h in f ? f[h] = w(
1769
- [...f[h], E],
1772
+ for (let u of o(s.properties))
1773
+ P(u, (y, m) => {
1774
+ let c = E(l.groups, y), d = E(l.groups, m);
1775
+ if (c > d || c === d && j(v(y, m, l))) {
1776
+ let g = (b) => {
1777
+ let N = {};
1778
+ for (let C of u) {
1779
+ let x = E(l.groups, C);
1780
+ x in N ? N[x] = w(
1781
+ [...N[x], C],
1770
1782
  l
1771
- ) : f[h] = [E];
1783
+ ) : N[x] = [C];
1772
1784
  }
1773
- let b = [];
1774
- for (let E of Object.keys(f).sort(
1775
- (h, C) => Number(h) - Number(C)
1785
+ let h = [];
1786
+ for (let C of Object.keys(N).sort(
1787
+ (x, S) => Number(x) - Number(S)
1776
1788
  ))
1777
- b.push(...w(f[E], l));
1789
+ h.push(...w(N[C], l));
1778
1790
  return L(
1779
- d,
1780
- i,
1781
1791
  b,
1792
+ u,
1793
+ h,
1782
1794
  t.sourceCode,
1783
1795
  {
1784
1796
  partitionComment: l["partition-by-comment"]
@@ -1788,11 +1800,11 @@ const Y = "sort-object-types", xe = O({
1788
1800
  t.report({
1789
1801
  messageId: "unexpectedObjectsOrder",
1790
1802
  data: {
1791
- left: A(o.name),
1792
- right: A(u.name)
1803
+ left: A(y.name),
1804
+ right: A(m.name)
1793
1805
  },
1794
- node: u.node,
1795
- fix: c
1806
+ node: m.node,
1807
+ fix: g
1796
1808
  });
1797
1809
  }
1798
1810
  });
@@ -1803,8 +1815,8 @@ const Y = "sort-object-types", xe = O({
1803
1815
  ObjectPattern: n
1804
1816
  };
1805
1817
  }
1806
- }), ae = "sort-classes", Oe = O({
1807
- name: ae,
1818
+ }), oe = "sort-classes", Ie = I({
1819
+ name: oe,
1808
1820
  meta: {
1809
1821
  type: "suggestion",
1810
1822
  docs: {
@@ -1829,8 +1841,8 @@ const Y = "sort-object-types", xe = O({
1829
1841
  default: !1
1830
1842
  },
1831
1843
  order: {
1832
- enum: [g.asc, g.desc],
1833
- default: g.asc,
1844
+ enum: [f.asc, f.desc],
1845
+ default: f.asc,
1834
1846
  type: "string"
1835
1847
  },
1836
1848
  groups: {
@@ -1848,41 +1860,41 @@ const Y = "sort-object-types", xe = O({
1848
1860
  defaultOptions: [
1849
1861
  {
1850
1862
  type: p.alphabetical,
1851
- order: g.asc
1863
+ order: f.asc
1852
1864
  }
1853
1865
  ],
1854
1866
  create: (t) => ({
1855
1867
  ClassBody: (n) => {
1856
1868
  if (n.body.length > 1) {
1857
- let s = j(t.options.at(0), {
1869
+ let s = k(t.options.at(0), {
1858
1870
  type: p.alphabetical,
1859
- order: g.asc,
1871
+ order: f.asc,
1860
1872
  "ignore-case": !1,
1861
1873
  groups: ["property", "constructor", "method", "unknown"]
1862
1874
  }), l = n.body.map((r) => {
1863
- var u;
1864
- let e, { getGroup: a, defineGroup: i } = G(s.groups);
1875
+ var y;
1876
+ let e, { getGroup: a, defineGroup: i } = M(s.groups);
1865
1877
  r.type === "StaticBlock" ? e = "static" : r.type === "TSIndexSignature" ? e = t.sourceCode.text.slice(
1866
1878
  r.range.at(0),
1867
- ((u = r.typeAnnotation) == null ? void 0 : u.range.at(0)) ?? r.range.at(1)
1879
+ ((y = r.typeAnnotation) == null ? void 0 : y.range.at(0)) ?? r.range.at(1)
1868
1880
  ) : r.key.type === "Identifier" ? { name: e } = r.key : e = t.sourceCode.text.slice(...r.key.range);
1869
- let o = e.startsWith("_") || e.startsWith("#");
1881
+ let o = e.startsWith("_") || e.startsWith("#"), u = "decorators" in r && r.decorators.length > 0;
1870
1882
  if (r.type === "MethodDefinition") {
1871
1883
  r.kind === "constructor" && i("constructor");
1872
- let y = r.accessibility === "private" || o, m = r.static;
1873
- y && m && i("static-private-method"), y && i("private-method"), m && i("static-method"), r.kind === "get" && i("get-method"), r.kind === "set" && i("set-method"), i("method");
1884
+ let m = r.accessibility === "private" || o, c = r.static;
1885
+ u && (r.kind === "get" && i("decorated-get-method"), r.kind === "set" && i("decorated-set-method"), i("decorated-method")), m && c && i("static-private-method"), m && i("private-method"), c && i("static-method"), r.kind === "get" && i("get-method"), r.kind === "set" && i("set-method"), i("method");
1874
1886
  } else
1875
- r.type === "TSIndexSignature" ? i("index-signature") : r.type === "PropertyDefinition" && ((r.accessibility === "private" || o) && i("private-property"), r.static && i("static-property"), i("property"));
1887
+ r.type === "TSIndexSignature" ? i("index-signature") : r.type === "AccessorProperty" ? u && ((r.accessibility === "private" || o) && i("private-decorated-accessor-property"), i("decorated-accessor-property")) : r.type === "PropertyDefinition" && (u && ((r.accessibility === "private" || o) && i("private-decorated-property"), i("decorated-property")), (r.accessibility === "private" || o) && i("private-property"), r.static && i("static-property"), i("property"));
1876
1888
  return {
1877
- size: v(r.range),
1889
+ size: O(r.range),
1878
1890
  group: a(),
1879
1891
  node: r,
1880
1892
  name: e
1881
1893
  };
1882
1894
  });
1883
- k(l, (r, e) => {
1884
- let a = x(s.groups, r), i = x(s.groups, e);
1885
- r.name !== e.name && (a > i || a === i && I(S(r, e, s))) && t.report({
1895
+ P(l, (r, e) => {
1896
+ let a = E(s.groups, r), i = E(s.groups, e);
1897
+ r.name !== e.name && (a > i || a === i && j(v(r, e, s))) && t.report({
1886
1898
  messageId: "unexpectedClassesOrder",
1887
1899
  data: {
1888
1900
  left: A(r.name),
@@ -1892,11 +1904,11 @@ const Y = "sort-object-types", xe = O({
1892
1904
  fix: (o) => {
1893
1905
  let u = [], y = l.reduce(
1894
1906
  (c, d) => {
1895
- let f = x(s.groups, d);
1896
- return f in c ? c[f] = w(
1897
- [...c[f], d],
1907
+ let g = E(s.groups, d);
1908
+ return g in c ? c[g] = w(
1909
+ [...c[g], d],
1898
1910
  s
1899
- ) : c[f] = [d], c;
1911
+ ) : c[g] = [d], c;
1900
1912
  },
1901
1913
  {}
1902
1914
  ), m = Object.keys(y).sort((c, d) => Number(c) - Number(d)).reduce(
@@ -1925,8 +1937,8 @@ const Y = "sort-object-types", xe = O({
1925
1937
  }
1926
1938
  }
1927
1939
  })
1928
- }), oe = "sort-enums", ve = O({
1929
- name: oe,
1940
+ }), ne = "sort-enums", Oe = I({
1941
+ name: ne,
1930
1942
  meta: {
1931
1943
  type: "suggestion",
1932
1944
  docs: {
@@ -1951,8 +1963,8 @@ const Y = "sort-object-types", xe = O({
1951
1963
  default: !1
1952
1964
  },
1953
1965
  order: {
1954
- enum: [g.asc, g.desc],
1955
- default: g.asc,
1966
+ enum: [f.asc, f.desc],
1967
+ default: f.asc,
1956
1968
  type: "string"
1957
1969
  }
1958
1970
  },
@@ -1966,23 +1978,23 @@ const Y = "sort-object-types", xe = O({
1966
1978
  defaultOptions: [
1967
1979
  {
1968
1980
  type: p.alphabetical,
1969
- order: g.asc
1981
+ order: f.asc
1970
1982
  }
1971
1983
  ],
1972
1984
  create: (t) => ({
1973
1985
  TSEnumDeclaration: (n) => {
1974
1986
  if (n.members.length > 1 && n.members.every(({ initializer: s }) => s)) {
1975
- let s = j(t.options.at(0), {
1987
+ let s = k(t.options.at(0), {
1976
1988
  type: p.alphabetical,
1977
- order: g.asc,
1989
+ order: f.asc,
1978
1990
  "ignore-case": !1
1979
1991
  }), l = n.members.map((r) => ({
1980
1992
  name: r.id.type === "Literal" ? `${r.id.value}` : `${t.sourceCode.text.slice(...r.id.range)}`,
1981
- size: v(r.range),
1993
+ size: O(r.range),
1982
1994
  node: r
1983
1995
  }));
1984
- k(l, (r, e) => {
1985
- I(S(r, e, s)) && t.report({
1996
+ P(l, (r, e) => {
1997
+ j(v(r, e, s)) && t.report({
1986
1998
  messageId: "unexpectedEnumsOrder",
1987
1999
  data: {
1988
2000
  left: A(r.name),
@@ -2000,8 +2012,8 @@ const Y = "sort-object-types", xe = O({
2000
2012
  }
2001
2013
  }
2002
2014
  })
2003
- }), ne = "sort-maps", Ie = O({
2004
- name: ne,
2015
+ }), le = "sort-maps", je = I({
2016
+ name: le,
2005
2017
  meta: {
2006
2018
  type: "suggestion",
2007
2019
  docs: {
@@ -2022,8 +2034,8 @@ const Y = "sort-object-types", xe = O({
2022
2034
  type: "string"
2023
2035
  },
2024
2036
  order: {
2025
- enum: [g.asc, g.desc],
2026
- default: g.asc,
2037
+ enum: [f.asc, f.desc],
2038
+ default: f.asc,
2027
2039
  type: "string"
2028
2040
  },
2029
2041
  "ignore-case": {
@@ -2041,7 +2053,7 @@ const Y = "sort-object-types", xe = O({
2041
2053
  defaultOptions: [
2042
2054
  {
2043
2055
  type: p.alphabetical,
2044
- order: g.asc
2056
+ order: f.asc
2045
2057
  }
2046
2058
  ],
2047
2059
  create: (t) => ({
@@ -2049,10 +2061,10 @@ const Y = "sort-object-types", xe = O({
2049
2061
  if (n.callee.type === "Identifier" && n.callee.name === "Map" && n.arguments.length && n.arguments[0].type === "ArrayExpression") {
2050
2062
  let [{ elements: s }] = n.arguments;
2051
2063
  if (s.length > 1) {
2052
- let l = j(t.options.at(0), {
2064
+ let l = k(t.options.at(0), {
2053
2065
  type: p.alphabetical,
2054
2066
  "ignore-case": !1,
2055
- order: g.asc
2067
+ order: f.asc
2056
2068
  }), r = s.reduce(
2057
2069
  (e, a) => (a === null || a.type === "SpreadElement" ? e.push([]) : e.at(-1).push(a), e),
2058
2070
  [[]]
@@ -2066,13 +2078,13 @@ const Y = "sort-object-types", xe = O({
2066
2078
  } else
2067
2079
  o = t.sourceCode.text.slice(...i.range);
2068
2080
  return {
2069
- size: v(i.range),
2081
+ size: O(i.range),
2070
2082
  node: i,
2071
2083
  name: o
2072
2084
  };
2073
2085
  });
2074
- k(a, (i, o) => {
2075
- I(S(i, o, l)) && t.report({
2086
+ P(a, (i, o) => {
2087
+ j(v(i, o, l)) && t.report({
2076
2088
  messageId: "unexpectedMapElementsOrder",
2077
2089
  data: {
2078
2090
  left: A(i.name),
@@ -2092,10 +2104,10 @@ const Y = "sort-object-types", xe = O({
2092
2104
  }
2093
2105
  }
2094
2106
  })
2095
- }), je = "eslint-plugin-perfectionist";
2096
- let W = (t) => {
2107
+ }), ke = "eslint-plugin-perfectionist";
2108
+ let V = (t) => {
2097
2109
  let n = {
2098
- [re]: [
2110
+ [se]: [
2099
2111
  "error",
2100
2112
  {
2101
2113
  groups: [
@@ -2116,7 +2128,7 @@ let W = (t) => {
2116
2128
  "internal-pattern": ["~/**"]
2117
2129
  }
2118
2130
  ],
2119
- [ae]: [
2131
+ [oe]: [
2120
2132
  "error",
2121
2133
  {
2122
2134
  groups: [
@@ -2133,21 +2145,20 @@ let W = (t) => {
2133
2145
  ]
2134
2146
  }
2135
2147
  ],
2136
- [se]: [
2148
+ [ae]: [
2137
2149
  "error",
2138
2150
  {
2139
2151
  "partition-by-comment": !1
2140
2152
  }
2141
2153
  ],
2142
- [q]: [
2154
+ [K]: [
2143
2155
  "error",
2144
2156
  {
2145
2157
  "spread-last": !0
2146
2158
  }
2147
2159
  ],
2148
- [J]: ["error"],
2149
2160
  [X]: ["error"],
2150
- [K]: ["error"],
2161
+ [q]: ["error"],
2151
2162
  [H]: ["error"],
2152
2163
  [Q]: ["error"],
2153
2164
  [Y]: ["error"],
@@ -2155,8 +2166,9 @@ let W = (t) => {
2155
2166
  [F]: ["error"],
2156
2167
  [ee]: ["error"],
2157
2168
  [te]: ["error"],
2158
- [oe]: ["error"],
2159
- [ne]: ["error"]
2169
+ [re]: ["error"],
2170
+ [ne]: ["error"],
2171
+ [le]: ["error"]
2160
2172
  };
2161
2173
  return {
2162
2174
  rules: Object.fromEntries(
@@ -2168,43 +2180,43 @@ let W = (t) => {
2168
2180
  plugins: ["perfectionist"]
2169
2181
  };
2170
2182
  };
2171
- const Ge = {
2183
+ const $e = {
2172
2184
  rules: {
2185
+ [K]: me,
2173
2186
  [q]: ye,
2174
- [X]: ge,
2175
- [ae]: Oe,
2176
- [oe]: ve,
2177
- [te]: we,
2187
+ [oe]: Ie,
2188
+ [ne]: Oe,
2178
2189
  [re]: Se,
2179
- [F]: Ce,
2190
+ [se]: ve,
2180
2191
  [ee]: Ne,
2181
- [ne]: Ie,
2182
- [H]: he,
2192
+ [te]: we,
2193
+ [le]: je,
2183
2194
  [Q]: be,
2184
2195
  [Y]: xe,
2185
- [se]: Ae,
2186
- [J]: fe,
2187
2196
  [Z]: Ee,
2188
- [K]: me
2197
+ [ae]: Ae,
2198
+ [X]: ge,
2199
+ [F]: Ce,
2200
+ [H]: he
2189
2201
  },
2190
2202
  configs: {
2191
- "recommended-alphabetical": W({
2203
+ "recommended-alphabetical": V({
2192
2204
  type: p.alphabetical,
2193
- order: g.asc,
2205
+ order: f.asc,
2194
2206
  "ignore-case": !1
2195
2207
  }),
2196
- "recommended-natural": W({
2208
+ "recommended-natural": V({
2197
2209
  type: p.natural,
2198
- order: g.asc,
2210
+ order: f.asc,
2199
2211
  "ignore-case": !1
2200
2212
  }),
2201
- "recommended-line-length": W({
2213
+ "recommended-line-length": V({
2202
2214
  type: p["line-length"],
2203
- order: g.desc
2215
+ order: f.desc
2204
2216
  })
2205
2217
  },
2206
- name: je
2218
+ name: ke
2207
2219
  };
2208
2220
  export {
2209
- Ge as default
2221
+ $e as default
2210
2222
  };