eslint-plugin-perfectionist 2.5.0 → 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
@@ -3,103 +3,103 @@ import { ESLintUtils as ue, ASTUtils as W } from "@typescript-eslint/utils";
3
3
  import { minimatch as $ } from "minimatch";
4
4
  import de from "natural-compare-lite";
5
5
  import { builtinModules as ce } from "node:module";
6
- let v = ue.RuleCreator(
6
+ let I = ue.RuleCreator(
7
7
  (t) => `https://eslint-plugin-perfectionist.azat.io/rules/${t}`
8
- ), E = (t, o) => {
8
+ ), E = (t, n) => {
9
9
  for (let s = 0, l = t.length; s < l; s++) {
10
10
  let r = t[s];
11
- if (o.group === r || Array.isArray(r) && typeof o.group == "string" && r.includes(o.group))
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
15
  }, O = (t) => {
16
- let [o, s] = t;
17
- return s - o;
16
+ let [n, s] = t;
17
+ return s - n;
18
18
  }, j = (t) => t > 0;
19
- var i = /* @__PURE__ */ ((t) => (t.alphabetical = "alphabetical", t["line-length"] = "line-length", t.natural = "natural", t))(i || {}), c = /* @__PURE__ */ ((t) => (t.desc = "desc", t.asc = "asc", t))(c || {});
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
20
  let M = (t) => {
21
- let o, s = (r) => {
22
- !o && t.flat().includes(r) && (o = r);
21
+ let n, s = (r) => {
22
+ !n && t.flat().includes(r) && (n = r);
23
23
  };
24
24
  return {
25
- getGroup: () => o ?? "unknown",
25
+ getGroup: () => n ?? "unknown",
26
26
  setCustomGroups: (r, e) => {
27
27
  if (r)
28
- for (let [a, p] of Object.entries(r))
29
- Array.isArray(p) && p.some(
30
- (n) => $(e, n, {
28
+ for (let [a, i] of Object.entries(r))
29
+ Array.isArray(i) && i.some(
30
+ (o) => $(e, o, {
31
31
  nocomment: !0
32
32
  })
33
- ) && s(a), typeof p == "string" && $(e, p, {
33
+ ) && s(a), typeof i == "string" && $(e, i, {
34
34
  nocomment: !0
35
35
  }) && s(a);
36
36
  },
37
37
  defineGroup: s
38
38
  };
39
- }, A = (t, o, s) => {
40
- var a, p;
41
- if ((a = o.dependencies) != null && a.includes(t.name))
39
+ }, v = (t, n, s) => {
40
+ var a, i;
41
+ if ((a = n.dependencies) != null && a.includes(t.name))
42
42
  return -1;
43
- if ((p = t.dependencies) != null && p.includes(o.name))
43
+ if ((i = t.dependencies) != null && i.includes(n.name))
44
44
  return 1;
45
- let l = s.order === "asc" ? 1 : -1, r, e = (n) => s["ignore-case"] ? n.toLowerCase() : n;
46
- return s.type === i.alphabetical ? r = (n, u) => e(n.name).localeCompare(e(u.name)) : s.type === i.natural ? r = (n, u) => de(e(n.name), e(u.name)) : r = (n, u) => {
47
- let y = n.size, m = u.size, f = s["max-line-length"];
48
- if (f) {
49
- let d = (g, b) => g > f && b.hasMultipleImportDeclarations;
50
- d(y, n) && (y = n.name.length + 10), d(m, u) && (m = u.name.length + 10);
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) => de(e(o.name), e(u.name)) : r = (o, u) => {
47
+ let y = o.size, m = u.size, c = s["max-line-length"];
48
+ if (c) {
49
+ let d = (g, b) => g > c && b.hasMultipleImportDeclarations;
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
- }, l * r(t, o);
54
- }, w = (t, o) => [...t].sort((s, l) => A(s, l, o)), fe = (t, o) => {
55
- let s = o.getTokenAfter(t, {
53
+ }, l * r(t, n);
54
+ }, w = (t, n) => [...t].sort((s, l) => v(s, l, n)), fe = (t, n) => {
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
- }, pe = (t, o) => Array.isArray(t) && t.some(
61
- (s) => $(o.trim(), s, {
60
+ }, pe = (t, n) => Array.isArray(t) && t.some(
61
+ (s) => $(n.trim(), s, {
62
62
  nocomment: !0
63
63
  })
64
- ) || typeof t == "string" && $(o.trim(), t, {
64
+ ) || typeof t == "string" && $(n.trim(), t, {
65
65
  nocomment: !0
66
- }) || t === !0, J = (t, o) => {
67
- let [s, l] = o.getTokensBefore(t, {
66
+ }) || t === !0, J = (t, n) => {
67
+ let [s, l] = n.getTokensBefore(t, {
68
68
  filter: ({ value: r, type: e }) => !(e === "Punctuator" && [",", ";"].includes(r)),
69
69
  includeComments: !0,
70
70
  count: 2
71
71
  });
72
72
  return ((l == null ? void 0 : l.type) === "Block" || (l == null ? void 0 : l.type) === "Line") && t.loc.start.line - l.loc.end.line <= 1 && (s == null ? void 0 : s.loc.end.line) !== l.loc.start.line ? l : null;
73
- }, T = (t, o, s) => {
74
- var p;
75
- let l = t.range.at(0), r = t.range.at(1), e = o.text.slice(l, r);
76
- if (W.isParenthesized(t, o)) {
77
- let n = o.getTokenBefore(
73
+ }, T = (t, n, s) => {
74
+ var i;
75
+ let l = t.range.at(0), r = t.range.at(1), e = n.text.slice(l, r);
76
+ if (W.isParenthesized(t, n)) {
77
+ let o = n.getTokenBefore(
78
78
  t,
79
79
  W.isOpeningParenToken
80
- ), u = o.getTokenAfter(
80
+ ), u = n.getTokenAfter(
81
81
  t,
82
82
  W.isClosingParenToken
83
83
  );
84
- l = n.range.at(0), r = u.range.at(1);
84
+ l = o.range.at(0), r = u.range.at(1);
85
85
  }
86
- let a = J(t, o);
86
+ let a = J(t, n);
87
87
  if (e.endsWith(";") || e.endsWith(",")) {
88
- let n = o.getTokensAfter(t, {
88
+ let o = n.getTokensAfter(t, {
89
89
  includeComments: !0,
90
90
  count: 2
91
91
  });
92
- t.loc.start.line === ((p = n.at(1)) == null ? void 0 : p.loc.start.line) && (r -= 1);
92
+ t.loc.start.line === ((i = o.at(1)) == null ? void 0 : i.loc.start.line) && (r -= 1);
93
93
  }
94
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];
98
- }, L = (t, o, s, l, r) => {
99
- var p, n;
100
- let e = [], a = ((p = o.at(0)) == null ? void 0 : p.node.loc.start.line) === ((n = o.at(-1)) == null ? void 0 : n.node.loc.end.line);
101
- for (let u = 0, y = o.length; u < y; u++) {
102
- let { node: m } = o.at(u);
98
+ }, L = (t, n, s, l, r) => {
99
+ var i, o;
100
+ let e = [], a = ((i = n.at(0)) == null ? void 0 : i.node.loc.start.line) === ((o = n.at(-1)) == null ? void 0 : o.node.loc.end.line);
101
+ for (let u = 0, y = n.length; u < y; u++) {
102
+ let { node: m } = n.at(u);
103
103
  e.push(
104
104
  t.replaceTextRange(
105
105
  T(m, l, r),
@@ -108,11 +108,11 @@ let M = (t) => {
108
108
  )
109
109
  )
110
110
  );
111
- let f = fe(s.at(u).node, l);
112
- if (f && !a) {
111
+ let c = fe(s.at(u).node, l);
112
+ if (c && !a) {
113
113
  let g = [
114
- l.getTokenBefore(f).range.at(1),
115
- f.range.at(1)
114
+ l.getTokenBefore(c).range.at(1),
115
+ c.range.at(1)
116
116
  ];
117
117
  e.push(t.replaceTextRange(g, ""));
118
118
  let b = l.getTokenAfter(m);
@@ -125,14 +125,14 @@ let M = (t) => {
125
125
  }
126
126
  }
127
127
  return e;
128
- }, k = (t = {}, o) => Object.assign(o, t), P = (t, o) => {
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
- l && r && o(l, r, s - 1);
132
+ l && r && n(l, r, s - 1);
133
133
  }
134
134
  };
135
- const X = "sort-svelte-attributes", ge = v({
135
+ const X = "sort-svelte-attributes", ge = I({
136
136
  name: X,
137
137
  meta: {
138
138
  type: "suggestion",
@@ -149,16 +149,16 @@ const X = "sort-svelte-attributes", ge = v({
149
149
  },
150
150
  type: {
151
151
  enum: [
152
- i.alphabetical,
153
- i.natural,
154
- i["line-length"]
152
+ p.alphabetical,
153
+ p.natural,
154
+ p["line-length"]
155
155
  ],
156
- default: i.alphabetical,
156
+ default: p.alphabetical,
157
157
  type: "string"
158
158
  },
159
159
  order: {
160
- enum: [c.asc, c.desc],
161
- default: c.asc,
160
+ enum: [f.asc, f.desc],
161
+ default: f.asc,
162
162
  type: "string"
163
163
  },
164
164
  "ignore-case": {
@@ -178,30 +178,30 @@ const X = "sort-svelte-attributes", ge = v({
178
178
  },
179
179
  defaultOptions: [
180
180
  {
181
- type: i.alphabetical,
182
- order: c.asc
181
+ type: p.alphabetical,
182
+ order: f.asc
183
183
  }
184
184
  ],
185
185
  create: (t) => _.extname(t.filename) !== ".svelte" ? {} : {
186
- SvelteStartTag: (o) => {
187
- if (o.attributes.length > 1) {
186
+ SvelteStartTag: (n) => {
187
+ if (n.attributes.length > 1) {
188
188
  let s = k(t.options.at(0), {
189
- type: i.alphabetical,
190
- order: c.asc,
189
+ type: p.alphabetical,
190
+ order: f.asc,
191
191
  "ignore-case": !1,
192
192
  "custom-groups": {},
193
193
  groups: []
194
- }), l = o.attributes.reduce(
194
+ }), l = n.attributes.reduce(
195
195
  (r, e) => {
196
196
  if (e.type === "SvelteSpreadAttribute")
197
197
  return r.push([]), r;
198
- let a, { getGroup: p, defineGroup: n, setCustomGroups: u } = M(
198
+ let a, { getGroup: i, defineGroup: o, setCustomGroups: u } = M(
199
199
  s.groups
200
200
  );
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" && (n("svelte-shorthand"), n("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && n("shorthand"), e.loc.start.line !== e.loc.end.line && n("multiline"), r.at(-1).push({
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
202
  size: O(e.range),
203
203
  node: e,
204
- group: p(),
204
+ group: i(),
205
205
  name: a
206
206
  }), r;
207
207
  },
@@ -209,8 +209,8 @@ const X = "sort-svelte-attributes", ge = v({
209
209
  );
210
210
  for (let r of l)
211
211
  P(r, (e, a) => {
212
- let p = E(s.groups, e), n = E(s.groups, a);
213
- (p > n || p === n && j(A(e, a, s))) && t.report({
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,
@@ -219,18 +219,18 @@ const X = "sort-svelte-attributes", ge = v({
219
219
  node: a.node,
220
220
  fix: (u) => {
221
221
  let y = {};
222
- for (let f of r) {
223
- let d = E(s.groups, f);
222
+ for (let c of r) {
223
+ let d = E(s.groups, c);
224
224
  d in y ? y[d] = w(
225
- [...y[d], f],
225
+ [...y[d], c],
226
226
  s
227
- ) : y[d] = [f];
227
+ ) : y[d] = [c];
228
228
  }
229
229
  let m = [];
230
- for (let f of Object.keys(y).sort(
230
+ for (let c of Object.keys(y).sort(
231
231
  (d, g) => Number(d) - Number(g)
232
232
  ))
233
- m.push(...w(y[f], s));
233
+ m.push(...w(y[c], s));
234
234
  return L(
235
235
  u,
236
236
  r,
@@ -243,7 +243,7 @@ const X = "sort-svelte-attributes", ge = v({
243
243
  }
244
244
  }
245
245
  }
246
- }), q = "sort-astro-attributes", ye = v({
246
+ }), q = "sort-astro-attributes", ye = I({
247
247
  name: q,
248
248
  meta: {
249
249
  type: "suggestion",
@@ -260,16 +260,16 @@ const X = "sort-svelte-attributes", ge = v({
260
260
  },
261
261
  type: {
262
262
  enum: [
263
- i.alphabetical,
264
- i.natural,
265
- i["line-length"]
263
+ p.alphabetical,
264
+ p.natural,
265
+ p["line-length"]
266
266
  ],
267
- default: i.alphabetical,
267
+ default: p.alphabetical,
268
268
  type: "string"
269
269
  },
270
270
  order: {
271
- enum: [c.asc, c.desc],
272
- default: c.asc,
271
+ enum: [f.asc, f.desc],
272
+ default: f.asc,
273
273
  type: "string"
274
274
  },
275
275
  "ignore-case": {
@@ -289,18 +289,18 @@ const X = "sort-svelte-attributes", ge = v({
289
289
  },
290
290
  defaultOptions: [
291
291
  {
292
- type: i.alphabetical,
293
- order: c.asc
292
+ type: p.alphabetical,
293
+ order: f.asc
294
294
  }
295
295
  ],
296
296
  // @ts-ignore
297
297
  create: (t) => _.extname(t.filename) !== ".astro" ? {} : {
298
- JSXElement: (o) => {
299
- let { attributes: s } = o.openingElement;
298
+ JSXElement: (n) => {
299
+ let { attributes: s } = n.openingElement;
300
300
  if (s.length > 1) {
301
301
  let l = k(t.options.at(0), {
302
- type: i.alphabetical,
303
- order: c.asc,
302
+ type: p.alphabetical,
303
+ order: f.asc,
304
304
  "ignore-case": !1,
305
305
  "custom-groups": {},
306
306
  groups: []
@@ -308,28 +308,28 @@ const X = "sort-svelte-attributes", ge = v({
308
308
  (e, a) => {
309
309
  if (a.type === "JSXSpreadAttribute")
310
310
  return e.push([]), e;
311
- let p = typeof a.name.name == "string" ? a.name.name : t.sourceCode.text.slice(...a.name.range), { getGroup: n, defineGroup: u, setCustomGroups: y } = M(
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
- return y(l["custom-groups"], p), 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({
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
315
  size: O(a.range),
316
316
  node: a,
317
- group: n(),
318
- name: p
317
+ group: o(),
318
+ name: i
319
319
  }), e;
320
320
  },
321
321
  [[]]
322
322
  );
323
323
  for (let e of r)
324
- P(e, (a, p) => {
325
- let n = E(l.groups, a), u = E(l.groups, p);
326
- (n > u || n === u && j(A(a, p, 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,
330
- right: p.name
330
+ right: i.name
331
331
  },
332
- node: p.node,
332
+ node: i.node,
333
333
  fix: (y) => {
334
334
  let m = {};
335
335
  for (let d of e) {
@@ -339,15 +339,15 @@ const X = "sort-svelte-attributes", ge = v({
339
339
  l
340
340
  ) : m[g] = [d];
341
341
  }
342
- let f = [];
342
+ let c = [];
343
343
  for (let d of Object.keys(m).sort(
344
344
  (g, b) => Number(g) - Number(b)
345
345
  ))
346
- f.push(...w(m[d], l));
346
+ c.push(...w(m[d], l));
347
347
  return L(
348
348
  y,
349
349
  e,
350
- f,
350
+ c,
351
351
  t.sourceCode
352
352
  );
353
353
  }
@@ -357,8 +357,8 @@ const X = "sort-svelte-attributes", ge = v({
357
357
  }
358
358
  }
359
359
  });
360
- let I = (t) => t.replaceAll(/\s\s+/g, " ").trim();
361
- const K = "sort-array-includes", me = v({
360
+ let A = (t) => t.replaceAll(/\s\s+/g, " ").trim();
361
+ const K = "sort-array-includes", me = I({
362
362
  name: K,
363
363
  meta: {
364
364
  type: "suggestion",
@@ -372,16 +372,16 @@ const K = "sort-array-includes", me = v({
372
372
  properties: {
373
373
  type: {
374
374
  enum: [
375
- i.alphabetical,
376
- i.natural,
377
- i["line-length"]
375
+ p.alphabetical,
376
+ p.natural,
377
+ p["line-length"]
378
378
  ],
379
- default: i.alphabetical,
379
+ default: p.alphabetical,
380
380
  type: "string"
381
381
  },
382
382
  order: {
383
- enum: [c.asc, c.desc],
384
- default: c.asc,
383
+ enum: [f.asc, f.desc],
384
+ default: f.asc,
385
385
  type: "string"
386
386
  },
387
387
  "ignore-case": {
@@ -402,18 +402,18 @@ const K = "sort-array-includes", me = v({
402
402
  },
403
403
  defaultOptions: [
404
404
  {
405
- type: i.alphabetical,
406
- order: c.asc
405
+ type: p.alphabetical,
406
+ order: f.asc
407
407
  }
408
408
  ],
409
409
  create: (t) => ({
410
- MemberExpression: (o) => {
411
- if ((o.object.type === "ArrayExpression" || o.object.type === "NewExpression") && o.property.type === "Identifier" && o.property.name === "includes") {
412
- let s = o.object.type === "ArrayExpression" ? o.object.elements : o.object.arguments;
410
+ MemberExpression: (n) => {
411
+ if ((n.object.type === "ArrayExpression" || n.object.type === "NewExpression") && n.property.type === "Identifier" && n.property.name === "includes") {
412
+ let s = n.object.type === "ArrayExpression" ? n.object.elements : n.object.arguments;
413
413
  if (s.length > 1) {
414
414
  let l = k(t.options.at(0), {
415
- type: i.alphabetical,
416
- order: c.asc,
415
+ type: p.alphabetical,
416
+ order: f.asc,
417
417
  "ignore-case": !1,
418
418
  "spread-last": !1
419
419
  }), r = s.reduce(
@@ -426,21 +426,21 @@ const K = "sort-array-includes", me = v({
426
426
  [[], []]
427
427
  ).flat();
428
428
  P(r, (e, a) => {
429
- let p;
430
- l["spread-last"] && e.node.type === "Literal" && a.node.type === "SpreadElement" ? p = !1 : l["spread-last"] && e.node.type === "SpreadElement" && a.node.type === "Literal" ? p = !0 : p = j(A(e, a, l)), p && t.report({
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 = j(v(e, a, l)), i && t.report({
431
431
  messageId: "unexpectedArrayIncludesOrder",
432
432
  data: {
433
- left: I(e.name),
434
- right: I(a.name)
433
+ left: A(e.name),
434
+ right: A(a.name)
435
435
  },
436
436
  node: a.node,
437
- fix: (n) => {
437
+ fix: (o) => {
438
438
  let u = w(r, l);
439
439
  if (l["spread-last"])
440
440
  for (let y = 0, m = u.length; y < m; y++)
441
441
  u.at(y).node.type === "SpreadElement" && u.push(u.splice(y, 1).at(0));
442
442
  return L(
443
- n,
443
+ o,
444
444
  r,
445
445
  u,
446
446
  t.sourceCode
@@ -452,7 +452,7 @@ const K = "sort-array-includes", me = v({
452
452
  }
453
453
  }
454
454
  })
455
- }), H = "sort-vue-attributes", he = v({
455
+ }), H = "sort-vue-attributes", he = I({
456
456
  name: H,
457
457
  meta: {
458
458
  type: "suggestion",
@@ -469,16 +469,16 @@ const K = "sort-array-includes", me = v({
469
469
  },
470
470
  type: {
471
471
  enum: [
472
- i.alphabetical,
473
- i.natural,
474
- i["line-length"]
472
+ p.alphabetical,
473
+ p.natural,
474
+ p["line-length"]
475
475
  ],
476
- default: i.alphabetical,
476
+ default: p.alphabetical,
477
477
  type: "string"
478
478
  },
479
479
  order: {
480
- enum: [c.asc, c.desc],
481
- default: c.asc,
480
+ enum: [f.asc, f.desc],
481
+ default: f.asc,
482
482
  type: "string"
483
483
  },
484
484
  "ignore-case": {
@@ -499,8 +499,8 @@ const K = "sort-array-includes", me = v({
499
499
  },
500
500
  defaultOptions: [
501
501
  {
502
- type: i.alphabetical,
503
- order: c.asc
502
+ type: p.alphabetical,
503
+ order: f.asc
504
504
  }
505
505
  ],
506
506
  create: (t) => {
@@ -508,13 +508,13 @@ const K = "sort-array-includes", me = v({
508
508
  return {};
509
509
  if (!("defineTemplateBodyVisitor" in t.sourceCode.parserServices))
510
510
  return {};
511
- let { defineTemplateBodyVisitor: o } = t.sourceCode.parserServices;
512
- return o({
511
+ let { defineTemplateBodyVisitor: n } = t.sourceCode.parserServices;
512
+ return n({
513
513
  VStartTag: (s) => {
514
514
  if (s.attributes.length > 1) {
515
515
  let l = k(t.options.at(0), {
516
- type: i.alphabetical,
517
- order: c.asc,
516
+ type: p.alphabetical,
517
+ order: f.asc,
518
518
  "ignore-case": !1,
519
519
  "custom-groups": {},
520
520
  groups: []
@@ -522,28 +522,28 @@ const K = "sort-array-includes", me = v({
522
522
  (e, a) => {
523
523
  if (a.key.type === "VDirectiveKey" && a.key.name.rawName === "bind")
524
524
  return e.push([]), e;
525
- let p, { getGroup: n, defineGroup: u, setCustomGroups: y } = M(
525
+ let i, { getGroup: o, defineGroup: u, setCustomGroups: y } = M(
526
526
  l.groups
527
527
  );
528
- return typeof a.key.name == "string" && a.key.type !== "VDirectiveKey" ? p = a.key.rawName : p = t.sourceCode.text.slice(...a.key.range), y(l["custom-groups"], p), a.value === null && u("shorthand"), a.loc.start.line !== a.loc.end.line && u("multiline"), e.at(-1).push({
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
529
  size: O(a.range),
530
530
  node: a,
531
- group: n(),
532
- name: p
531
+ group: o(),
532
+ name: i
533
533
  }), e;
534
534
  },
535
535
  [[]]
536
536
  );
537
537
  for (let e of r)
538
- P(e, (a, p) => {
539
- let n = E(l.groups, a), u = E(l.groups, p);
540
- (n > u || n === u && j(A(a, p, 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,
544
- right: p.name
544
+ right: i.name
545
545
  },
546
- node: p.node,
546
+ node: i.node,
547
547
  fix: (y) => {
548
548
  let m = {};
549
549
  for (let d of e) {
@@ -553,15 +553,15 @@ const K = "sort-array-includes", me = v({
553
553
  l
554
554
  ) : m[g] = [d];
555
555
  }
556
- let f = [];
556
+ let c = [];
557
557
  for (let d of Object.keys(m).sort(
558
558
  (g, b) => Number(g) - Number(b)
559
559
  ))
560
- f.push(...w(m[d], l));
560
+ c.push(...w(m[d], l));
561
561
  return L(
562
562
  y,
563
563
  e,
564
- f,
564
+ c,
565
565
  t.sourceCode
566
566
  );
567
567
  }
@@ -571,7 +571,7 @@ const K = "sort-array-includes", me = v({
571
571
  }
572
572
  });
573
573
  }
574
- }), Q = "sort-named-exports", be = v({
574
+ }), Q = "sort-named-exports", be = I({
575
575
  name: Q,
576
576
  meta: {
577
577
  type: "suggestion",
@@ -585,16 +585,16 @@ const K = "sort-array-includes", me = v({
585
585
  properties: {
586
586
  type: {
587
587
  enum: [
588
- i.alphabetical,
589
- i.natural,
590
- i["line-length"]
588
+ p.alphabetical,
589
+ p.natural,
590
+ p["line-length"]
591
591
  ],
592
- default: i.alphabetical,
592
+ default: p.alphabetical,
593
593
  type: "string"
594
594
  },
595
595
  order: {
596
- enum: [c.asc, c.desc],
597
- default: c.asc,
596
+ enum: [f.asc, f.desc],
597
+ default: f.asc,
598
598
  type: "string"
599
599
  },
600
600
  "ignore-case": {
@@ -611,24 +611,24 @@ const K = "sort-array-includes", me = v({
611
611
  },
612
612
  defaultOptions: [
613
613
  {
614
- type: i.alphabetical,
615
- order: c.asc
614
+ type: p.alphabetical,
615
+ order: f.asc
616
616
  }
617
617
  ],
618
618
  create: (t) => ({
619
- ExportNamedDeclaration: (o) => {
620
- if (o.specifiers.length > 1) {
619
+ ExportNamedDeclaration: (n) => {
620
+ if (n.specifiers.length > 1) {
621
621
  let s = k(t.options.at(0), {
622
- type: i.alphabetical,
622
+ type: p.alphabetical,
623
623
  "ignore-case": !1,
624
- order: c.asc
625
- }), l = o.specifiers.map((r) => ({
624
+ order: f.asc
625
+ }), l = n.specifiers.map((r) => ({
626
626
  size: O(r.range),
627
627
  name: r.local.name,
628
628
  node: r
629
629
  }));
630
630
  P(l, (r, e) => {
631
- j(A(r, e, s)) && t.report({
631
+ j(v(r, e, s)) && t.report({
632
632
  messageId: "unexpectedNamedExportsOrder",
633
633
  data: {
634
634
  left: r.name,
@@ -646,7 +646,7 @@ const K = "sort-array-includes", me = v({
646
646
  }
647
647
  }
648
648
  })
649
- }), Y = "sort-named-imports", xe = v({
649
+ }), Y = "sort-named-imports", xe = I({
650
650
  name: Y,
651
651
  meta: {
652
652
  type: "suggestion",
@@ -660,16 +660,16 @@ const K = "sort-array-includes", me = v({
660
660
  properties: {
661
661
  type: {
662
662
  enum: [
663
- i.alphabetical,
664
- i.natural,
665
- i["line-length"]
663
+ p.alphabetical,
664
+ p.natural,
665
+ p["line-length"]
666
666
  ],
667
- default: i.alphabetical,
667
+ default: p.alphabetical,
668
668
  type: "string"
669
669
  },
670
670
  order: {
671
- enum: [c.asc, c.desc],
672
- default: c.asc,
671
+ enum: [f.asc, f.desc],
672
+ default: f.asc,
673
673
  type: "string"
674
674
  },
675
675
  "ignore-case": {
@@ -690,21 +690,21 @@ const K = "sort-array-includes", me = v({
690
690
  },
691
691
  defaultOptions: [
692
692
  {
693
- type: i.alphabetical,
694
- order: c.asc
693
+ type: p.alphabetical,
694
+ order: f.asc
695
695
  }
696
696
  ],
697
697
  create: (t) => ({
698
- ImportDeclaration: (o) => {
699
- let s = o.specifiers.filter(
698
+ ImportDeclaration: (n) => {
699
+ let s = n.specifiers.filter(
700
700
  ({ type: l }) => l === "ImportSpecifier"
701
701
  );
702
702
  if (s.length > 1) {
703
703
  let l = k(t.options.at(0), {
704
- type: i.alphabetical,
704
+ type: p.alphabetical,
705
705
  "ignore-alias": !0,
706
706
  "ignore-case": !1,
707
- order: c.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), {
@@ -714,15 +714,15 @@ const K = "sort-array-includes", me = v({
714
714
  };
715
715
  });
716
716
  P(r, (e, a) => {
717
- j(A(e, a, l)) && t.report({
717
+ j(v(e, a, l)) && t.report({
718
718
  messageId: "unexpectedNamedImportsOrder",
719
719
  data: {
720
720
  left: e.name,
721
721
  right: a.name
722
722
  },
723
723
  node: a.node,
724
- fix: (p) => L(
725
- p,
724
+ fix: (i) => L(
725
+ i,
726
726
  r,
727
727
  w(r, l),
728
728
  t.sourceCode
@@ -733,11 +733,11 @@ const K = "sort-array-includes", me = v({
733
733
  }
734
734
  })
735
735
  });
736
- let z = (t, o, s) => t.lines.slice(
737
- o.node.loc.end.line,
736
+ let z = (t, n, s) => t.lines.slice(
737
+ n.node.loc.end.line,
738
738
  s.node.loc.start.line - 1
739
739
  ).filter((r) => !r.trim().length).length;
740
- const Z = "sort-object-types", Ee = v({
740
+ const Z = "sort-object-types", Ee = I({
741
741
  name: Z,
742
742
  meta: {
743
743
  type: "suggestion",
@@ -754,16 +754,16 @@ const Z = "sort-object-types", Ee = v({
754
754
  },
755
755
  type: {
756
756
  enum: [
757
- i.alphabetical,
758
- i.natural,
759
- i["line-length"]
757
+ p.alphabetical,
758
+ p.natural,
759
+ p["line-length"]
760
760
  ],
761
- default: i.alphabetical,
761
+ default: p.alphabetical,
762
762
  type: "string"
763
763
  },
764
764
  order: {
765
- enum: [c.asc, c.desc],
766
- default: c.asc,
765
+ enum: [f.asc, f.desc],
766
+ default: f.asc,
767
767
  type: "string"
768
768
  },
769
769
  "ignore-case": {
@@ -788,29 +788,29 @@ const Z = "sort-object-types", Ee = v({
788
788
  },
789
789
  defaultOptions: [
790
790
  {
791
- type: i.alphabetical,
792
- order: c.asc
791
+ type: p.alphabetical,
792
+ order: f.asc
793
793
  }
794
794
  ],
795
795
  create: (t) => ({
796
- TSTypeLiteral: (o) => {
797
- if (o.members.length > 1) {
796
+ TSTypeLiteral: (n) => {
797
+ if (n.members.length > 1) {
798
798
  let s = k(t.options.at(0), {
799
799
  "partition-by-new-line": !1,
800
- type: i.alphabetical,
800
+ type: p.alphabetical,
801
801
  "ignore-case": !1,
802
- order: c.asc,
802
+ order: f.asc,
803
803
  "custom-groups": {},
804
804
  groups: []
805
- }), l = o.members.reduce(
805
+ }), l = n.members.reduce(
806
806
  (r, e) => {
807
807
  var N, h, C, x;
808
- let a, p = t.sourceCode.text.slice(
808
+ let a, i = t.sourceCode.text.slice(
809
809
  e.range.at(0),
810
810
  e.range.at(1)
811
- ), n = (N = r.at(-1)) == null ? void 0 : N.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: m } = M(
811
+ ), o = (N = r.at(-1)) == null ? void 0 : N.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: m } = M(
812
812
  s.groups
813
- ), f = (S) => S.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),
@@ -818,23 +818,23 @@ const Z = "sort-object-types", Ee = v({
818
818
  );
819
819
  else if (e.type === "TSIndexSignature") {
820
820
  let S = ((C = e.typeAnnotation) == null ? void 0 : C.range.at(0)) ?? e.range.at(1);
821
- a = f(
821
+ a = c(
822
822
  t.sourceCode.text.slice(e.range.at(0), S)
823
823
  );
824
824
  } else
825
- a = f(
825
+ a = c(
826
826
  t.sourceCode.text.slice(
827
827
  e.range.at(0),
828
828
  e.range.at(1)
829
829
  )
830
830
  );
831
831
  m(s["custom-groups"], a), e.loc.start.line !== e.loc.end.line && y("multiline");
832
- let g = p.endsWith(";") || p.endsWith(",") ? 1 : 0, b = {
832
+ let g = i.endsWith(";") || i.endsWith(",") ? 1 : 0, b = {
833
833
  size: O(e.range) - g,
834
834
  node: e,
835
835
  name: a
836
836
  };
837
- return s["partition-by-new-line"] && n && z(t.sourceCode, n, b) && r.push([]), (x = r.at(-1)) == null || x.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;
@@ -843,28 +843,28 @@ const Z = "sort-object-types", Ee = v({
843
843
  );
844
844
  for (let r of l)
845
845
  P(r, (e, a) => {
846
- let p = E(s.groups, e), n = E(s.groups, a);
847
- (p > n || p === n && j(A(e, a, s))) && t.report({
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
- left: I(e.name),
851
- right: I(a.name)
850
+ left: A(e.name),
851
+ right: A(a.name)
852
852
  },
853
853
  node: a.node,
854
854
  fix: (u) => {
855
855
  let y = {};
856
- for (let f of r) {
857
- let d = E(s.groups, f);
856
+ for (let c of r) {
857
+ let d = E(s.groups, c);
858
858
  d in y ? y[d] = w(
859
- [...y[d], f],
859
+ [...y[d], c],
860
860
  s
861
- ) : y[d] = [f];
861
+ ) : y[d] = [c];
862
862
  }
863
863
  let m = [];
864
- for (let f of Object.keys(y).sort(
864
+ for (let c of Object.keys(y).sort(
865
865
  (d, g) => Number(d) - Number(g)
866
866
  ))
867
- m.push(...w(y[f], s));
867
+ m.push(...w(y[c], s));
868
868
  return L(
869
869
  u,
870
870
  r,
@@ -877,7 +877,7 @@ const Z = "sort-object-types", Ee = v({
877
877
  }
878
878
  }
879
879
  })
880
- }), F = "sort-union-types", Ce = v({
880
+ }), F = "sort-union-types", Ce = I({
881
881
  name: F,
882
882
  meta: {
883
883
  type: "suggestion",
@@ -891,16 +891,16 @@ const Z = "sort-object-types", Ee = v({
891
891
  properties: {
892
892
  type: {
893
893
  enum: [
894
- i.alphabetical,
895
- i.natural,
896
- i["line-length"]
894
+ p.alphabetical,
895
+ p.natural,
896
+ p["line-length"]
897
897
  ],
898
- default: i.alphabetical,
898
+ default: p.alphabetical,
899
899
  type: "string"
900
900
  },
901
901
  order: {
902
- enum: [c.asc, c.desc],
903
- default: c.asc,
902
+ enum: [f.asc, f.desc],
903
+ default: f.asc,
904
904
  type: "string"
905
905
  },
906
906
  "ignore-case": {
@@ -921,49 +921,49 @@ const Z = "sort-object-types", Ee = v({
921
921
  },
922
922
  defaultOptions: [
923
923
  {
924
- type: i.alphabetical,
925
- order: c.asc
924
+ type: p.alphabetical,
925
+ order: f.asc
926
926
  }
927
927
  ],
928
928
  create: (t) => ({
929
- TSUnionType: (o) => {
929
+ TSUnionType: (n) => {
930
930
  let s = k(t.options.at(0), {
931
- type: i.alphabetical,
931
+ type: p.alphabetical,
932
932
  "nullable-last": !1,
933
933
  "ignore-case": !1,
934
- order: c.asc
935
- }), l = o.types.map((r) => ({
934
+ order: f.asc
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
938
  size: O(r.range),
939
939
  node: r
940
940
  }));
941
941
  P(l, (r, e) => {
942
- let a = j(A(r, e, s));
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: {
946
- left: I(r.name),
947
- right: I(e.name)
946
+ left: A(r.name),
947
+ right: A(e.name)
948
948
  },
949
949
  node: e.node,
950
- fix: (p) => {
951
- let n = [];
950
+ fix: (i) => {
951
+ let o = [];
952
952
  if (s["nullable-last"]) {
953
953
  let u = [], y = l.filter((m) => m.group === "nullable" ? (u.push(m), !1) : !0);
954
- n = [
954
+ o = [
955
955
  ...w(y, s),
956
956
  ...w(u, s)
957
957
  ];
958
958
  } else
959
- n = w(l, s);
960
- return L(p, l, n, t.sourceCode);
959
+ o = w(l, s);
960
+ return L(i, l, o, t.sourceCode);
961
961
  }
962
962
  });
963
963
  });
964
964
  }
965
965
  })
966
- }), ee = "sort-interfaces", Ne = v({
966
+ }), ee = "sort-interfaces", Ne = I({
967
967
  name: ee,
968
968
  meta: {
969
969
  type: "suggestion",
@@ -980,16 +980,16 @@ const Z = "sort-object-types", Ee = v({
980
980
  },
981
981
  type: {
982
982
  enum: [
983
- i.alphabetical,
984
- i.natural,
985
- i["line-length"]
983
+ p.alphabetical,
984
+ p.natural,
985
+ p["line-length"]
986
986
  ],
987
- default: i.alphabetical,
987
+ default: p.alphabetical,
988
988
  type: "string"
989
989
  },
990
990
  order: {
991
- enum: [c.asc, c.desc],
992
- default: c.asc,
991
+ enum: [f.asc, f.desc],
992
+ default: f.asc,
993
993
  type: "string"
994
994
  },
995
995
  "ignore-case": {
@@ -1020,53 +1020,53 @@ const Z = "sort-object-types", Ee = v({
1020
1020
  },
1021
1021
  defaultOptions: [
1022
1022
  {
1023
- type: i.alphabetical,
1024
- order: c.asc
1023
+ type: p.alphabetical,
1024
+ order: f.asc
1025
1025
  }
1026
1026
  ],
1027
1027
  create: (t) => ({
1028
- TSInterfaceDeclaration: (o) => {
1029
- if (o.body.body.length > 1) {
1028
+ TSInterfaceDeclaration: (n) => {
1029
+ if (n.body.body.length > 1) {
1030
1030
  let s = k(t.options.at(0), {
1031
1031
  "partition-by-new-line": !1,
1032
- type: i.alphabetical,
1032
+ type: p.alphabetical,
1033
1033
  "ignore-case": !1,
1034
- order: c.asc,
1034
+ order: f.asc,
1035
1035
  "ignore-pattern": [],
1036
1036
  "custom-groups": {},
1037
1037
  groups: []
1038
1038
  });
1039
1039
  if (!s["ignore-pattern"].some(
1040
- (l) => $(o.id.name, l, {
1040
+ (l) => $(n.id.name, l, {
1041
1041
  nocomment: !0
1042
1042
  })
1043
1043
  )) {
1044
- let l = o.body.body.reduce(
1044
+ let l = n.body.body.reduce(
1045
1045
  (r, e) => {
1046
- var f, d, g, b;
1046
+ var c, d, g, b;
1047
1047
  if (e.type === "TSCallSignatureDeclaration")
1048
1048
  return r.push([]), r;
1049
- let a = (f = r.at(-1)) == null ? void 0 : f.at(-1), p, { getGroup: n, defineGroup: u, setCustomGroups: y } = M(
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")
1053
1053
  if (e.key.type === "Identifier")
1054
- ({ name: p } = e.key);
1054
+ ({ name: i } = e.key);
1055
1055
  else if (e.key.type === "Literal")
1056
- p = `${e.key.value}`;
1056
+ i = `${e.key.value}`;
1057
1057
  else {
1058
1058
  let N = ((d = e.typeAnnotation) == null ? void 0 : d.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
1059
- p = t.sourceCode.text.slice(e.range.at(0), N);
1059
+ i = t.sourceCode.text.slice(e.range.at(0), N);
1060
1060
  }
1061
1061
  else if (e.type === "TSIndexSignature") {
1062
1062
  let N = ((g = e.typeAnnotation) == null ? void 0 : g.range.at(0)) ?? e.range.at(1);
1063
- p = t.sourceCode.text.slice(
1063
+ i = t.sourceCode.text.slice(
1064
1064
  e.range.at(0),
1065
1065
  N
1066
1066
  );
1067
1067
  } else {
1068
1068
  let N = ((b = e.returnType) == null ? void 0 : b.range.at(0)) ?? e.range.at(1);
1069
- p = t.sourceCode.text.slice(
1069
+ i = t.sourceCode.text.slice(
1070
1070
  e.range.at(0),
1071
1071
  N
1072
1072
  );
@@ -1074,43 +1074,43 @@ const Z = "sort-object-types", Ee = v({
1074
1074
  let m = {
1075
1075
  size: O(e.range),
1076
1076
  node: e,
1077
- name: p
1077
+ name: i
1078
1078
  };
1079
1079
  return s["partition-by-new-line"] && a && z(
1080
1080
  t.sourceCode,
1081
1081
  a,
1082
1082
  m
1083
- ) && r.push([]), y(s["custom-groups"], p), e.loc.start.line !== e.loc.end.line && u("multiline"), r.at(-1).push({
1083
+ ) && r.push([]), y(s["custom-groups"], i), e.loc.start.line !== e.loc.end.line && u("multiline"), r.at(-1).push({
1084
1084
  ...m,
1085
- group: n()
1085
+ group: o()
1086
1086
  }), r;
1087
1087
  },
1088
1088
  [[]]
1089
1089
  );
1090
1090
  for (let r of l)
1091
1091
  P(r, (e, a) => {
1092
- let p = E(s.groups, e), n = E(s.groups, a);
1093
- (p > n || p === n && j(A(e, a, s))) && t.report({
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
- left: I(e.name),
1097
- right: I(a.name)
1096
+ left: A(e.name),
1097
+ right: A(a.name)
1098
1098
  },
1099
1099
  node: a.node,
1100
1100
  fix: (u) => {
1101
1101
  let y = {};
1102
- for (let f of r) {
1103
- let d = E(s.groups, f);
1102
+ for (let c of r) {
1103
+ let d = E(s.groups, c);
1104
1104
  d in y ? y[d] = w(
1105
- [...y[d], f],
1105
+ [...y[d], c],
1106
1106
  s
1107
- ) : y[d] = [f];
1107
+ ) : y[d] = [c];
1108
1108
  }
1109
1109
  let m = [];
1110
- for (let f of Object.keys(y).sort(
1110
+ for (let c of Object.keys(y).sort(
1111
1111
  (d, g) => Number(d) - Number(g)
1112
1112
  ))
1113
- m.push(...w(y[f], s));
1113
+ m.push(...w(y[c], s));
1114
1114
  return L(
1115
1115
  u,
1116
1116
  r,
@@ -1124,7 +1124,7 @@ const Z = "sort-object-types", Ee = v({
1124
1124
  }
1125
1125
  }
1126
1126
  })
1127
- }), te = "sort-jsx-props", we = v({
1127
+ }), te = "sort-jsx-props", we = I({
1128
1128
  name: te,
1129
1129
  meta: {
1130
1130
  type: "suggestion",
@@ -1141,16 +1141,16 @@ const Z = "sort-object-types", Ee = v({
1141
1141
  },
1142
1142
  type: {
1143
1143
  enum: [
1144
- i.alphabetical,
1145
- i.natural,
1146
- i["line-length"]
1144
+ p.alphabetical,
1145
+ p.natural,
1146
+ p["line-length"]
1147
1147
  ],
1148
- default: i.alphabetical,
1148
+ default: p.alphabetical,
1149
1149
  type: "string"
1150
1150
  },
1151
1151
  order: {
1152
- enum: [c.asc, c.desc],
1153
- default: c.asc,
1152
+ enum: [f.asc, f.desc],
1153
+ default: f.asc,
1154
1154
  type: "string"
1155
1155
  },
1156
1156
  groups: {
@@ -1170,30 +1170,30 @@ const Z = "sort-object-types", Ee = v({
1170
1170
  },
1171
1171
  defaultOptions: [
1172
1172
  {
1173
- type: i.alphabetical,
1174
- order: c.asc
1173
+ type: p.alphabetical,
1174
+ order: f.asc
1175
1175
  }
1176
1176
  ],
1177
1177
  create: (t) => [".svelte", ".astro", ".vue"].includes(_.extname(t.filename)) ? {} : {
1178
- JSXElement: (o) => {
1179
- if (o.openingElement.attributes.length > 1) {
1178
+ JSXElement: (n) => {
1179
+ if (n.openingElement.attributes.length > 1) {
1180
1180
  let s = k(t.options.at(0), {
1181
- type: i.alphabetical,
1181
+ type: p.alphabetical,
1182
1182
  "ignore-case": !1,
1183
- order: c.asc,
1183
+ order: f.asc,
1184
1184
  "custom-groups": {},
1185
1185
  groups: []
1186
- }), l = o.openingElement.attributes.reduce(
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: p, defineGroup: n, setCustomGroups: u } = M(
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
- u(s["custom-groups"], a), e.value === null && n("shorthand"), e.loc.start.line !== e.loc.end.line && n("multiline");
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
1195
  size: O(e.range),
1196
- group: p(),
1196
+ group: i(),
1197
1197
  node: e,
1198
1198
  name: a
1199
1199
  };
@@ -1203,8 +1203,8 @@ const Z = "sort-object-types", Ee = v({
1203
1203
  );
1204
1204
  for (let r of l)
1205
1205
  P(r, (e, a) => {
1206
- let p = E(s.groups, e), n = E(s.groups, a);
1207
- (p > n || p === n && j(A(e, a, s))) && t.report({
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,
@@ -1213,18 +1213,18 @@ const Z = "sort-object-types", Ee = v({
1213
1213
  node: a.node,
1214
1214
  fix: (u) => {
1215
1215
  let y = {};
1216
- for (let f of r) {
1217
- let d = E(s.groups, f);
1216
+ for (let c of r) {
1217
+ let d = E(s.groups, c);
1218
1218
  d in y ? y[d] = w(
1219
- [...y[d], f],
1219
+ [...y[d], c],
1220
1220
  s
1221
- ) : y[d] = [f];
1221
+ ) : y[d] = [c];
1222
1222
  }
1223
1223
  let m = [];
1224
- for (let f of Object.keys(y).sort(
1224
+ for (let c of Object.keys(y).sort(
1225
1225
  (d, g) => Number(d) - Number(g)
1226
1226
  ))
1227
- m.push(...w(y[f], s));
1227
+ m.push(...w(y[c], s));
1228
1228
  return L(
1229
1229
  u,
1230
1230
  r,
@@ -1237,7 +1237,7 @@ const Z = "sort-object-types", Ee = v({
1237
1237
  }
1238
1238
  }
1239
1239
  }
1240
- }), re = "sort-exports", Se = v({
1240
+ }), re = "sort-exports", Se = I({
1241
1241
  name: re,
1242
1242
  meta: {
1243
1243
  type: "suggestion",
@@ -1251,16 +1251,16 @@ const Z = "sort-object-types", Ee = v({
1251
1251
  properties: {
1252
1252
  type: {
1253
1253
  enum: [
1254
- i.alphabetical,
1255
- i.natural,
1256
- i["line-length"]
1254
+ p.alphabetical,
1255
+ p.natural,
1256
+ p["line-length"]
1257
1257
  ],
1258
- default: i.alphabetical,
1258
+ default: p.alphabetical,
1259
1259
  type: "string"
1260
1260
  },
1261
1261
  order: {
1262
- enum: [c.asc, c.desc],
1263
- default: c.asc,
1262
+ enum: [f.asc, f.desc],
1263
+ default: f.asc,
1264
1264
  type: "string"
1265
1265
  },
1266
1266
  "ignore-case": {
@@ -1277,14 +1277,14 @@ const Z = "sort-object-types", Ee = v({
1277
1277
  },
1278
1278
  defaultOptions: [
1279
1279
  {
1280
- type: i.alphabetical,
1281
- order: c.asc
1280
+ type: p.alphabetical,
1281
+ order: f.asc
1282
1282
  }
1283
1283
  ],
1284
1284
  create: (t) => {
1285
- let o = k(t.options.at(0), {
1286
- type: i.alphabetical,
1287
- order: c.asc,
1285
+ let n = k(t.options.at(0), {
1286
+ type: p.alphabetical,
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({
@@ -1301,17 +1301,17 @@ const Z = "sort-object-types", Ee = v({
1301
1301
  "Program:exit": () => {
1302
1302
  for (let r of s)
1303
1303
  P(r, (e, a) => {
1304
- j(A(e, a, o)) && t.report({
1304
+ j(v(e, a, n)) && t.report({
1305
1305
  messageId: "unexpectedExportsOrder",
1306
1306
  data: {
1307
1307
  left: e.name,
1308
1308
  right: a.name
1309
1309
  },
1310
1310
  node: a.node,
1311
- fix: (p) => L(
1312
- p,
1311
+ fix: (i) => L(
1312
+ i,
1313
1313
  r,
1314
- w(r, o),
1314
+ w(r, n),
1315
1315
  t.sourceCode
1316
1316
  )
1317
1317
  });
@@ -1319,7 +1319,7 @@ const Z = "sort-object-types", Ee = v({
1319
1319
  }
1320
1320
  };
1321
1321
  }
1322
- }), se = "sort-imports", Ae = v({
1322
+ }), se = "sort-imports", ve = I({
1323
1323
  name: se,
1324
1324
  meta: {
1325
1325
  type: "suggestion",
@@ -1346,16 +1346,16 @@ const Z = "sort-object-types", Ee = v({
1346
1346
  },
1347
1347
  type: {
1348
1348
  enum: [
1349
- i.alphabetical,
1350
- i.natural,
1351
- i["line-length"]
1349
+ p.alphabetical,
1350
+ p.natural,
1351
+ p["line-length"]
1352
1352
  ],
1353
- default: i.alphabetical,
1353
+ default: p.alphabetical,
1354
1354
  type: "string"
1355
1355
  },
1356
1356
  order: {
1357
- enum: [c.asc, c.desc],
1358
- default: c.asc,
1357
+ enum: [f.asc, f.desc],
1358
+ default: f.asc,
1359
1359
  type: "string"
1360
1360
  },
1361
1361
  "ignore-case": {
@@ -1398,7 +1398,7 @@ const Z = "sort-object-types", Ee = v({
1398
1398
  definitions: {
1399
1399
  "is-line-length": {
1400
1400
  properties: {
1401
- type: { enum: [i["line-length"]], type: "string" }
1401
+ type: { enum: [p["line-length"]], type: "string" }
1402
1402
  },
1403
1403
  required: ["type"],
1404
1404
  type: "object"
@@ -1423,28 +1423,28 @@ const Z = "sort-object-types", Ee = v({
1423
1423
  },
1424
1424
  defaultOptions: [
1425
1425
  {
1426
- type: i.alphabetical,
1427
- order: c.asc
1426
+ type: p.alphabetical,
1427
+ order: f.asc
1428
1428
  }
1429
1429
  ],
1430
1430
  create: (t) => {
1431
- let o = k(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
- type: i.alphabetical,
1436
- order: c.asc,
1435
+ type: p.alphabetical,
1436
+ order: f.asc,
1437
1437
  "ignore-case": !1,
1438
1438
  groups: []
1439
1439
  }), s = !1;
1440
- for (let n of o.groups)
1441
- if (Array.isArray(n))
1442
- for (let u of n)
1440
+ for (let o of n.groups)
1441
+ if (Array.isArray(o))
1442
+ for (let u of o)
1443
1443
  u === "unknown" && (s = !0);
1444
1444
  else
1445
- n === "unknown" && (s = !0);
1446
- s || (o.groups = [...o.groups, "unknown"]);
1447
- let l = [], r = (n) => n.type === "ImportDeclaration" && n.specifiers.length === 0, e = (n) => {
1445
+ o === "unknown" && (s = !0);
1446
+ s || (n.groups = [...n.groups, "unknown"]);
1447
+ let l = [], r = (o) => o.type === "ImportDeclaration" && o.specifiers.length === 0, e = (o) => {
1448
1448
  let u = (x) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1449
1449
  (S) => x.endsWith(S)
1450
1450
  ), y = (x) => [
@@ -1455,7 +1455,7 @@ const Z = "sort-object-types", Ee = v({
1455
1455
  "./index",
1456
1456
  "./",
1457
1457
  "."
1458
- ].includes(x), m = (x) => x.indexOf("..") === 0, f = (x) => x.indexOf("./") === 0, { getGroup: d, defineGroup: g, setCustomGroups: b } = M(o.groups), N = (x) => o["internal-pattern"].length && o["internal-pattern"].some(
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
1459
  (S) => $(x.source.value, S, {
1460
1460
  nocomment: !0
1461
1461
  })
@@ -1475,39 +1475,39 @@ const Z = "sort-object-types", Ee = v({
1475
1475
  x.startsWith("node:") ? x.split("node:")[1] : x
1476
1476
  ) || S.includes(x);
1477
1477
  }, C = (x) => !(x.startsWith(".") || x.startsWith("/"));
1478
- return n.importKind === "type" && (n.type === "ImportDeclaration" && (b(o["custom-groups"].type, n.source.value), y(n.source.value) && g("index-type"), f(n.source.value) && g("sibling-type"), m(n.source.value) && g("parent-type"), N(n) && g("internal-type"), h(n.source.value) && g("builtin-type"), C(n.source.value) && g("external-type")), g("type")), n.type === "ImportDeclaration" && (b(o["custom-groups"].value, n.source.value), r(n) && u(n.source.value) && g("side-effect-style"), r(n) && g("side-effect"), u(n.source.value) && g("style"), y(n.source.value) && g("index"), f(n.source.value) && g("sibling"), m(n.source.value) && g("parent"), N(n) && g("internal"), h(n.source.value) && g("builtin"), C(n.source.value) && g("external")), d();
1479
- }, a = (n) => n.specifiers.length > 1, p = (n) => {
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
+ }, a = (o) => o.specifiers.length > 1, i = (o) => {
1480
1480
  let u;
1481
- n.type === "ImportDeclaration" ? u = n.source.value : n.moduleReference.type === "TSExternalModuleReference" && n.moduleReference.expression.type === "Literal" ? u = `${n.moduleReference.expression.value}` : u = t.sourceCode.text.slice(...n.moduleReference.range), l.push({
1482
- size: O(n.range),
1483
- group: e(n),
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: O(o.range),
1483
+ group: e(o),
1484
1484
  name: u,
1485
- node: n,
1486
- ...o.type === i["line-length"] && o["max-line-length"] && {
1485
+ node: o,
1486
+ ...n.type === p["line-length"] && n["max-line-length"] && {
1487
1487
  hasMultipleImportDeclarations: a(
1488
- n
1488
+ o
1489
1489
  )
1490
1490
  }
1491
1491
  });
1492
1492
  };
1493
1493
  return {
1494
- TSImportEqualsDeclaration: p,
1495
- ImportDeclaration: p,
1494
+ TSImportEqualsDeclaration: i,
1495
+ ImportDeclaration: i,
1496
1496
  "Program:exit": () => {
1497
1497
  var m;
1498
- let n = (f, d) => !!t.sourceCode.getTokensBetween(
1499
- f.node,
1498
+ let o = (c, d) => !!t.sourceCode.getTokensBetween(
1499
+ c.node,
1500
1500
  J(d.node, t.sourceCode) || d.node,
1501
1501
  {
1502
1502
  includeComments: !0
1503
1503
  }
1504
- ).length, u = (f, d) => {
1504
+ ).length, u = (c, d) => {
1505
1505
  let g = [], b = {};
1506
1506
  for (let h of d) {
1507
- let C = E(o.groups, h);
1507
+ let C = E(n.groups, h);
1508
1508
  C in b ? b[C] = w(
1509
1509
  [...b[C], h],
1510
- o
1510
+ n
1511
1511
  ) : b[C] = [h];
1512
1512
  }
1513
1513
  let N = Object.keys(b).sort((h, C) => Number(h) - Number(C)).reduce(
@@ -1520,13 +1520,13 @@ const Z = "sort-object-types", Ee = v({
1520
1520
  for (let h = 0, C = N.length; h < C; h++) {
1521
1521
  let x = N.at(h);
1522
1522
  if (g.push(
1523
- f.replaceTextRange(
1523
+ c.replaceTextRange(
1524
1524
  T(d.at(h).node, t.sourceCode),
1525
1525
  t.sourceCode.text.slice(
1526
1526
  ...T(x.node, t.sourceCode)
1527
1527
  )
1528
1528
  )
1529
- ), o["newlines-between"] !== "ignore") {
1529
+ ), n["newlines-between"] !== "ignore") {
1530
1530
  let S = N.at(h + 1);
1531
1531
  if (S) {
1532
1532
  let G = z(
@@ -1534,8 +1534,8 @@ const Z = "sort-object-types", Ee = v({
1534
1534
  d.at(h),
1535
1535
  d.at(h + 1)
1536
1536
  );
1537
- (o["newlines-between"] === "always" && E(o.groups, x) === E(o.groups, S) && G !== 0 || o["newlines-between"] === "never" && G > 0) && g.push(
1538
- f.removeRange([
1537
+ (n["newlines-between"] === "always" && E(n.groups, x) === E(n.groups, S) && G !== 0 || n["newlines-between"] === "never" && G > 0) && g.push(
1538
+ c.removeRange([
1539
1539
  T(
1540
1540
  d.at(h).node,
1541
1541
  t.sourceCode
@@ -1545,8 +1545,8 @@ const Z = "sort-object-types", Ee = v({
1545
1545
  t.sourceCode
1546
1546
  ).at(0) - 1
1547
1547
  ])
1548
- ), o["newlines-between"] === "always" && E(o.groups, x) !== E(o.groups, S) && G > 1 && g.push(
1549
- f.replaceTextRange(
1548
+ ), n["newlines-between"] === "always" && E(n.groups, x) !== E(n.groups, S) && G > 1 && g.push(
1549
+ c.replaceTextRange(
1550
1550
  [
1551
1551
  T(
1552
1552
  d.at(h).node,
@@ -1560,8 +1560,8 @@ const Z = "sort-object-types", Ee = v({
1560
1560
  `
1561
1561
  `
1562
1562
  )
1563
- ), o["newlines-between"] === "always" && E(o.groups, x) !== E(o.groups, S) && G === 0 && g.push(
1564
- f.insertTextAfterRange(
1563
+ ), n["newlines-between"] === "always" && E(n.groups, x) !== E(n.groups, S) && G === 0 && g.push(
1564
+ c.insertTextAfterRange(
1565
1565
  T(d.at(h).node, t.sourceCode),
1566
1566
  `
1567
1567
  `
@@ -1572,41 +1572,41 @@ const Z = "sort-object-types", Ee = v({
1572
1572
  }
1573
1573
  return g;
1574
1574
  }, y = [[]];
1575
- for (let f of l) {
1575
+ for (let c of l) {
1576
1576
  let d = (m = y.at(-1)) == null ? void 0 : m.at(-1);
1577
- d && n(d, f) ? y.push([f]) : y.at(-1).push(f);
1577
+ d && o(d, c) ? y.push([c]) : y.at(-1).push(c);
1578
1578
  }
1579
- for (let f of y)
1580
- P(f, (d, g) => {
1581
- let b = E(o.groups, d), N = E(o.groups, g), h = z(
1579
+ for (let c of y)
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
1584
  g
1585
1585
  );
1586
- !(r(d.node) && r(g.node)) && !n(d, g) && (b > N || b === N && j(A(d, g, o))) && 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
1590
  right: g.name
1591
1591
  },
1592
1592
  node: g.node,
1593
- fix: (C) => u(C, f)
1594
- }), o["newlines-between"] === "never" && h > 0 && t.report({
1593
+ fix: (C) => u(C, c)
1594
+ }), n["newlines-between"] === "never" && h > 0 && t.report({
1595
1595
  messageId: "extraSpacingBetweenImports",
1596
1596
  data: {
1597
1597
  left: d.name,
1598
1598
  right: g.name
1599
1599
  },
1600
1600
  node: g.node,
1601
- fix: (C) => u(C, f)
1602
- }), o["newlines-between"] === "always" && (b < N && h === 0 ? t.report({
1601
+ fix: (C) => u(C, c)
1602
+ }), n["newlines-between"] === "always" && (b < N && h === 0 ? t.report({
1603
1603
  messageId: "missedSpacingBetweenImports",
1604
1604
  data: {
1605
1605
  left: d.name,
1606
1606
  right: g.name
1607
1607
  },
1608
1608
  node: g.node,
1609
- fix: (C) => u(C, f)
1609
+ fix: (C) => u(C, c)
1610
1610
  }) : (h > 1 || b === N && h > 0) && t.report({
1611
1611
  messageId: "extraSpacingBetweenImports",
1612
1612
  data: {
@@ -1614,13 +1614,13 @@ const Z = "sort-object-types", Ee = v({
1614
1614
  right: g.name
1615
1615
  },
1616
1616
  node: g.node,
1617
- fix: (C) => u(C, f)
1617
+ fix: (C) => u(C, c)
1618
1618
  }));
1619
1619
  });
1620
1620
  }
1621
1621
  };
1622
1622
  }
1623
- }), ae = "sort-objects", Ie = v({
1623
+ }), ae = "sort-objects", Ae = I({
1624
1624
  name: ae,
1625
1625
  meta: {
1626
1626
  type: "suggestion",
@@ -1649,16 +1649,16 @@ const Z = "sort-object-types", Ee = v({
1649
1649
  },
1650
1650
  type: {
1651
1651
  enum: [
1652
- i.alphabetical,
1653
- i.natural,
1654
- i["line-length"]
1652
+ p.alphabetical,
1653
+ p.natural,
1654
+ p["line-length"]
1655
1655
  ],
1656
- default: i.alphabetical,
1656
+ default: p.alphabetical,
1657
1657
  type: "string"
1658
1658
  },
1659
1659
  order: {
1660
- enum: [c.asc, c.desc],
1661
- default: c.asc,
1660
+ enum: [f.asc, f.desc],
1661
+ default: f.asc,
1662
1662
  type: "string"
1663
1663
  },
1664
1664
  "ignore-case": {
@@ -1684,20 +1684,20 @@ const Z = "sort-object-types", Ee = v({
1684
1684
  },
1685
1685
  defaultOptions: [
1686
1686
  {
1687
- type: i.alphabetical,
1688
- order: c.asc
1687
+ type: p.alphabetical,
1688
+ order: f.asc
1689
1689
  }
1690
1690
  ],
1691
1691
  create: (t) => {
1692
- let o = (s) => {
1692
+ let n = (s) => {
1693
1693
  let l = k(t.options.at(0), {
1694
1694
  "partition-by-new-line": !1,
1695
1695
  "partition-by-comment": !1,
1696
- type: i.alphabetical,
1696
+ type: p.alphabetical,
1697
1697
  "styled-components": !0,
1698
1698
  "ignore-case": !1,
1699
1699
  "ignore-pattern": [],
1700
- order: c.asc,
1700
+ order: f.asc,
1701
1701
  "custom-groups": {},
1702
1702
  groups: []
1703
1703
  }), r = s.parent.type === "VariableDeclarator" && s.parent.id.type === "Identifier" ? s.parent.id.name : null;
@@ -1706,18 +1706,18 @@ const Z = "sort-object-types", Ee = v({
1706
1706
  nocomment: !0
1707
1707
  })
1708
1708
  ) : !1) && s.properties.length > 1) {
1709
- let a = (u) => u.type === "Identifier" && u.name === "styled", p = (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"] && (p(s.parent) || s.parent.type === "ArrowFunctionExpression" && p(s.parent.parent)))
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)))
1711
1711
  return;
1712
- let n = (u) => u.reduce(
1712
+ let o = (u) => u.reduce(
1713
1713
  (y, m) => {
1714
1714
  var G;
1715
1715
  if (m.type === "SpreadElement" || m.type === "RestElement")
1716
1716
  return y.push([]), y;
1717
- let f = J(m, t.sourceCode), d = (G = y.at(-1)) == null ? void 0 : G.at(-1);
1718
- l["partition-by-comment"] && f && pe(
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(
1719
1719
  l["partition-by-comment"],
1720
- f.value
1720
+ c.value
1721
1721
  ) && y.push([]);
1722
1722
  let g, b = "ignore", N = [], { getGroup: h, setCustomGroups: C } = M(l.groups);
1723
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);
@@ -1769,10 +1769,10 @@ const Z = "sort-object-types", Ee = v({
1769
1769
  },
1770
1770
  [[]]
1771
1771
  );
1772
- for (let u of n(s.properties))
1772
+ for (let u of o(s.properties))
1773
1773
  P(u, (y, m) => {
1774
- let f = E(l.groups, y), d = E(l.groups, m);
1775
- if (f > d || f === d && j(A(y, m, l))) {
1774
+ let c = E(l.groups, y), d = E(l.groups, m);
1775
+ if (c > d || c === d && j(v(y, m, l))) {
1776
1776
  let g = (b) => {
1777
1777
  let N = {};
1778
1778
  for (let C of u) {
@@ -1800,8 +1800,8 @@ const Z = "sort-object-types", Ee = v({
1800
1800
  t.report({
1801
1801
  messageId: "unexpectedObjectsOrder",
1802
1802
  data: {
1803
- left: I(y.name),
1804
- right: I(m.name)
1803
+ left: A(y.name),
1804
+ right: A(m.name)
1805
1805
  },
1806
1806
  node: m.node,
1807
1807
  fix: g
@@ -1811,11 +1811,11 @@ const Z = "sort-object-types", Ee = v({
1811
1811
  }
1812
1812
  };
1813
1813
  return {
1814
- ObjectExpression: o,
1815
- ObjectPattern: o
1814
+ ObjectExpression: n,
1815
+ ObjectPattern: n
1816
1816
  };
1817
1817
  }
1818
- }), oe = "sort-classes", ve = v({
1818
+ }), oe = "sort-classes", Ie = I({
1819
1819
  name: oe,
1820
1820
  meta: {
1821
1821
  type: "suggestion",
@@ -1829,11 +1829,11 @@ const Z = "sort-object-types", Ee = v({
1829
1829
  properties: {
1830
1830
  type: {
1831
1831
  enum: [
1832
- i.alphabetical,
1833
- i.natural,
1834
- i["line-length"]
1832
+ p.alphabetical,
1833
+ p.natural,
1834
+ p["line-length"]
1835
1835
  ],
1836
- default: i.alphabetical,
1836
+ default: p.alphabetical,
1837
1837
  type: "string"
1838
1838
  },
1839
1839
  "ignore-case": {
@@ -1841,8 +1841,8 @@ const Z = "sort-object-types", Ee = v({
1841
1841
  default: !1
1842
1842
  },
1843
1843
  order: {
1844
- enum: [c.asc, c.desc],
1845
- default: c.asc,
1844
+ enum: [f.asc, f.desc],
1845
+ default: f.asc,
1846
1846
  type: "string"
1847
1847
  },
1848
1848
  groups: {
@@ -1859,32 +1859,32 @@ const Z = "sort-object-types", Ee = v({
1859
1859
  },
1860
1860
  defaultOptions: [
1861
1861
  {
1862
- type: i.alphabetical,
1863
- order: c.asc
1862
+ type: p.alphabetical,
1863
+ order: f.asc
1864
1864
  }
1865
1865
  ],
1866
1866
  create: (t) => ({
1867
- ClassBody: (o) => {
1868
- if (o.body.length > 1) {
1867
+ ClassBody: (n) => {
1868
+ if (n.body.length > 1) {
1869
1869
  let s = k(t.options.at(0), {
1870
- type: i.alphabetical,
1871
- order: c.asc,
1870
+ type: p.alphabetical,
1871
+ order: f.asc,
1872
1872
  "ignore-case": !1,
1873
1873
  groups: ["property", "constructor", "method", "unknown"]
1874
- }), l = o.body.map((r) => {
1875
- var u;
1876
- let e, { getGroup: a, defineGroup: p } = M(s.groups);
1874
+ }), l = n.body.map((r) => {
1875
+ var y;
1876
+ let e, { getGroup: a, defineGroup: i } = M(s.groups);
1877
1877
  r.type === "StaticBlock" ? e = "static" : r.type === "TSIndexSignature" ? e = t.sourceCode.text.slice(
1878
1878
  r.range.at(0),
1879
- ((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)
1880
1880
  ) : r.key.type === "Identifier" ? { name: e } = r.key : e = t.sourceCode.text.slice(...r.key.range);
1881
- let n = e.startsWith("_") || e.startsWith("#");
1881
+ let o = e.startsWith("_") || e.startsWith("#"), u = "decorators" in r && r.decorators.length > 0;
1882
1882
  if (r.type === "MethodDefinition") {
1883
- r.kind === "constructor" && p("constructor");
1884
- let y = r.accessibility === "private" || n, m = r.static;
1885
- y && m && p("static-private-method"), y && p("private-method"), m && p("static-method"), r.kind === "get" && p("get-method"), r.kind === "set" && p("set-method"), p("method");
1883
+ r.kind === "constructor" && i("constructor");
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");
1886
1886
  } else
1887
- r.type === "TSIndexSignature" ? p("index-signature") : r.type === "PropertyDefinition" && ((r.accessibility === "private" || n) && p("private-property"), r.static && p("static-property"), p("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"));
1888
1888
  return {
1889
1889
  size: O(r.range),
1890
1890
  group: a(),
@@ -1893,38 +1893,38 @@ const Z = "sort-object-types", Ee = v({
1893
1893
  };
1894
1894
  });
1895
1895
  P(l, (r, e) => {
1896
- let a = E(s.groups, r), p = E(s.groups, e);
1897
- r.name !== e.name && (a > p || a === p && j(A(r, e, s))) && t.report({
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({
1898
1898
  messageId: "unexpectedClassesOrder",
1899
1899
  data: {
1900
- left: I(r.name),
1901
- right: I(e.name)
1900
+ left: A(r.name),
1901
+ right: A(e.name)
1902
1902
  },
1903
1903
  node: e.node,
1904
- fix: (n) => {
1904
+ fix: (o) => {
1905
1905
  let u = [], y = l.reduce(
1906
- (f, d) => {
1906
+ (c, d) => {
1907
1907
  let g = E(s.groups, d);
1908
- return g in f ? f[g] = w(
1909
- [...f[g], d],
1908
+ return g in c ? c[g] = w(
1909
+ [...c[g], d],
1910
1910
  s
1911
- ) : f[g] = [d], f;
1911
+ ) : c[g] = [d], c;
1912
1912
  },
1913
1913
  {}
1914
- ), m = Object.keys(y).sort((f, d) => Number(f) - Number(d)).reduce(
1915
- (f, d) => [
1916
- ...f,
1914
+ ), m = Object.keys(y).sort((c, d) => Number(c) - Number(d)).reduce(
1915
+ (c, d) => [
1916
+ ...c,
1917
1917
  ...y[d]
1918
1918
  ],
1919
1919
  []
1920
1920
  );
1921
- for (let f = 0, d = m.length; f < d; f++)
1921
+ for (let c = 0, d = m.length; c < d; c++)
1922
1922
  u.push(
1923
- n.replaceTextRange(
1924
- T(l.at(f).node, t.sourceCode),
1923
+ o.replaceTextRange(
1924
+ T(l.at(c).node, t.sourceCode),
1925
1925
  t.sourceCode.text.slice(
1926
1926
  ...T(
1927
- m.at(f).node,
1927
+ m.at(c).node,
1928
1928
  t.sourceCode
1929
1929
  )
1930
1930
  )
@@ -1937,7 +1937,7 @@ const Z = "sort-object-types", Ee = v({
1937
1937
  }
1938
1938
  }
1939
1939
  })
1940
- }), ne = "sort-enums", Oe = v({
1940
+ }), ne = "sort-enums", Oe = I({
1941
1941
  name: ne,
1942
1942
  meta: {
1943
1943
  type: "suggestion",
@@ -1951,11 +1951,11 @@ const Z = "sort-object-types", Ee = v({
1951
1951
  properties: {
1952
1952
  type: {
1953
1953
  enum: [
1954
- i.alphabetical,
1955
- i.natural,
1956
- i["line-length"]
1954
+ p.alphabetical,
1955
+ p.natural,
1956
+ p["line-length"]
1957
1957
  ],
1958
- default: i.alphabetical,
1958
+ default: p.alphabetical,
1959
1959
  type: "string"
1960
1960
  },
1961
1961
  "ignore-case": {
@@ -1963,8 +1963,8 @@ const Z = "sort-object-types", Ee = v({
1963
1963
  default: !1
1964
1964
  },
1965
1965
  order: {
1966
- enum: [c.asc, c.desc],
1967
- default: c.asc,
1966
+ enum: [f.asc, f.desc],
1967
+ default: f.asc,
1968
1968
  type: "string"
1969
1969
  }
1970
1970
  },
@@ -1977,28 +1977,28 @@ const Z = "sort-object-types", Ee = v({
1977
1977
  },
1978
1978
  defaultOptions: [
1979
1979
  {
1980
- type: i.alphabetical,
1981
- order: c.asc
1980
+ type: p.alphabetical,
1981
+ order: f.asc
1982
1982
  }
1983
1983
  ],
1984
1984
  create: (t) => ({
1985
- TSEnumDeclaration: (o) => {
1986
- if (o.members.length > 1 && o.members.every(({ initializer: s }) => s)) {
1985
+ TSEnumDeclaration: (n) => {
1986
+ if (n.members.length > 1 && n.members.every(({ initializer: s }) => s)) {
1987
1987
  let s = k(t.options.at(0), {
1988
- type: i.alphabetical,
1989
- order: c.asc,
1988
+ type: p.alphabetical,
1989
+ order: f.asc,
1990
1990
  "ignore-case": !1
1991
- }), l = o.members.map((r) => ({
1991
+ }), l = n.members.map((r) => ({
1992
1992
  name: r.id.type === "Literal" ? `${r.id.value}` : `${t.sourceCode.text.slice(...r.id.range)}`,
1993
1993
  size: O(r.range),
1994
1994
  node: r
1995
1995
  }));
1996
1996
  P(l, (r, e) => {
1997
- j(A(r, e, s)) && t.report({
1997
+ j(v(r, e, s)) && t.report({
1998
1998
  messageId: "unexpectedEnumsOrder",
1999
1999
  data: {
2000
- left: I(r.name),
2001
- right: I(e.name)
2000
+ left: A(r.name),
2001
+ right: A(e.name)
2002
2002
  },
2003
2003
  node: e.node,
2004
2004
  fix: (a) => L(
@@ -2012,7 +2012,7 @@ const Z = "sort-object-types", Ee = v({
2012
2012
  }
2013
2013
  }
2014
2014
  })
2015
- }), le = "sort-maps", je = v({
2015
+ }), le = "sort-maps", je = I({
2016
2016
  name: le,
2017
2017
  meta: {
2018
2018
  type: "suggestion",
@@ -2026,16 +2026,16 @@ const Z = "sort-object-types", Ee = v({
2026
2026
  properties: {
2027
2027
  type: {
2028
2028
  enum: [
2029
- i.alphabetical,
2030
- i.natural,
2031
- i["line-length"]
2029
+ p.alphabetical,
2030
+ p.natural,
2031
+ p["line-length"]
2032
2032
  ],
2033
- default: i.alphabetical,
2033
+ default: p.alphabetical,
2034
2034
  type: "string"
2035
2035
  },
2036
2036
  order: {
2037
- enum: [c.asc, c.desc],
2038
- default: c.asc,
2037
+ enum: [f.asc, f.desc],
2038
+ default: f.asc,
2039
2039
  type: "string"
2040
2040
  },
2041
2041
  "ignore-case": {
@@ -2052,45 +2052,45 @@ const Z = "sort-object-types", Ee = v({
2052
2052
  },
2053
2053
  defaultOptions: [
2054
2054
  {
2055
- type: i.alphabetical,
2056
- order: c.asc
2055
+ type: p.alphabetical,
2056
+ order: f.asc
2057
2057
  }
2058
2058
  ],
2059
2059
  create: (t) => ({
2060
- NewExpression: (o) => {
2061
- if (o.callee.type === "Identifier" && o.callee.name === "Map" && o.arguments.length && o.arguments[0].type === "ArrayExpression") {
2062
- let [{ elements: s }] = o.arguments;
2060
+ NewExpression: (n) => {
2061
+ if (n.callee.type === "Identifier" && n.callee.name === "Map" && n.arguments.length && n.arguments[0].type === "ArrayExpression") {
2062
+ let [{ elements: s }] = n.arguments;
2063
2063
  if (s.length > 1) {
2064
2064
  let l = k(t.options.at(0), {
2065
- type: i.alphabetical,
2065
+ type: p.alphabetical,
2066
2066
  "ignore-case": !1,
2067
- order: c.asc
2067
+ order: f.asc
2068
2068
  }), r = s.reduce(
2069
2069
  (e, a) => (a === null || a.type === "SpreadElement" ? e.push([]) : e.at(-1).push(a), e),
2070
2070
  [[]]
2071
2071
  );
2072
2072
  for (let e of r) {
2073
- let a = e.map((p) => {
2074
- let n;
2075
- if (p.type === "ArrayExpression") {
2076
- let [u] = p.elements;
2077
- u ? u.type === "Literal" ? n = u.raw : n = t.sourceCode.text.slice(...u.range) : n = `${u}`;
2073
+ let a = e.map((i) => {
2074
+ let o;
2075
+ if (i.type === "ArrayExpression") {
2076
+ let [u] = i.elements;
2077
+ u ? u.type === "Literal" ? o = u.raw : o = t.sourceCode.text.slice(...u.range) : o = `${u}`;
2078
2078
  } else
2079
- n = t.sourceCode.text.slice(...p.range);
2079
+ o = t.sourceCode.text.slice(...i.range);
2080
2080
  return {
2081
- size: O(p.range),
2082
- node: p,
2083
- name: n
2081
+ size: O(i.range),
2082
+ node: i,
2083
+ name: o
2084
2084
  };
2085
2085
  });
2086
- P(a, (p, n) => {
2087
- j(A(p, n, l)) && t.report({
2086
+ P(a, (i, o) => {
2087
+ j(v(i, o, l)) && t.report({
2088
2088
  messageId: "unexpectedMapElementsOrder",
2089
2089
  data: {
2090
- left: I(p.name),
2091
- right: I(n.name)
2090
+ left: A(i.name),
2091
+ right: A(o.name)
2092
2092
  },
2093
- node: n.node,
2093
+ node: o.node,
2094
2094
  fix: (u) => L(
2095
2095
  u,
2096
2096
  a,
@@ -2106,7 +2106,7 @@ const Z = "sort-object-types", Ee = v({
2106
2106
  })
2107
2107
  }), ke = "eslint-plugin-perfectionist";
2108
2108
  let V = (t) => {
2109
- let o = {
2109
+ let n = {
2110
2110
  [se]: [
2111
2111
  "error",
2112
2112
  {
@@ -2172,7 +2172,7 @@ let V = (t) => {
2172
2172
  };
2173
2173
  return {
2174
2174
  rules: Object.fromEntries(
2175
- Object.entries(o).map(([s, [l, r = {}]]) => [
2175
+ Object.entries(n).map(([s, [l, r = {}]]) => [
2176
2176
  `perfectionist/${s}`,
2177
2177
  [l, Object.assign(r, t)]
2178
2178
  ])
@@ -2184,35 +2184,35 @@ const $e = {
2184
2184
  rules: {
2185
2185
  [K]: me,
2186
2186
  [q]: ye,
2187
- [oe]: ve,
2187
+ [oe]: Ie,
2188
2188
  [ne]: Oe,
2189
2189
  [re]: Se,
2190
- [se]: Ae,
2190
+ [se]: ve,
2191
2191
  [ee]: Ne,
2192
2192
  [te]: we,
2193
2193
  [le]: je,
2194
2194
  [Q]: be,
2195
2195
  [Y]: xe,
2196
2196
  [Z]: Ee,
2197
- [ae]: Ie,
2197
+ [ae]: Ae,
2198
2198
  [X]: ge,
2199
2199
  [F]: Ce,
2200
2200
  [H]: he
2201
2201
  },
2202
2202
  configs: {
2203
2203
  "recommended-alphabetical": V({
2204
- type: i.alphabetical,
2205
- order: c.asc,
2204
+ type: p.alphabetical,
2205
+ order: f.asc,
2206
2206
  "ignore-case": !1
2207
2207
  }),
2208
2208
  "recommended-natural": V({
2209
- type: i.natural,
2210
- order: c.asc,
2209
+ type: p.natural,
2210
+ order: f.asc,
2211
2211
  "ignore-case": !1
2212
2212
  }),
2213
2213
  "recommended-line-length": V({
2214
- type: i["line-length"],
2215
- order: c.desc
2214
+ type: p["line-length"],
2215
+ order: f.desc
2216
2216
  })
2217
2217
  },
2218
2218
  name: ke