eslint-plugin-perfectionist 2.3.0 → 2.4.1

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,139 +1,139 @@
1
- import _ from "node:path";
2
- import { ESLintUtils as ue, ASTUtils as W } from "@typescript-eslint/utils";
3
- import { minimatch as D } from "minimatch";
4
- import ce from "natural-compare-lite";
1
+ import B from "node:path";
2
+ import { ESLintUtils as pe, ASTUtils as _ } from "@typescript-eslint/utils";
3
+ import { minimatch as $ } from "minimatch";
4
+ import ue from "natural-compare-lite";
5
5
  import { builtinModules as de } from "node:module";
6
- let j = ue.RuleCreator(
7
- (r) => `https://eslint-plugin-perfectionist.azat.io/rules/${r}`
8
- ), x = (r, l) => {
9
- for (let s = 0, t = r.length; s < t; s++) {
10
- let u = r[s];
11
- if (l.group === u || Array.isArray(u) && typeof l.group == "string" && u.includes(l.group))
6
+ let O = pe.RuleCreator(
7
+ (t) => `https://eslint-plugin-perfectionist.azat.io/rules/${t}`
8
+ ), x = (t, n) => {
9
+ for (let s = 0, l = t.length; s < l; s++) {
10
+ let r = t[s];
11
+ if (n.group === r || Array.isArray(r) && typeof n.group == "string" && r.includes(n.group))
12
12
  return s;
13
13
  }
14
- return r.length;
15
- }, v = (r) => {
16
- let [l, s] = r;
17
- return s - l;
18
- }, k = (r) => r > 0;
19
- var p = /* @__PURE__ */ ((r) => (r.alphabetical = "alphabetical", r["line-length"] = "line-length", r.natural = "natural", r))(p || {}), d = /* @__PURE__ */ ((r) => (r.desc = "desc", r.asc = "asc", r))(d || {});
20
- let R = (r) => {
21
- let l, s = (u) => {
22
- !l && r.flat().includes(u) && (l = u);
14
+ return t.length;
15
+ }, v = (t) => {
16
+ let [n, s] = t;
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) => {
21
+ let n, s = (r) => {
22
+ !n && t.flat().includes(r) && (n = r);
23
23
  };
24
24
  return {
25
- getGroup: () => l ?? "unknown",
26
- setCustomGroups: (u, n) => {
27
- if (u)
28
- for (let [e, a] of Object.entries(u))
29
- Array.isArray(a) && a.some(
30
- (i) => D(n, i, {
25
+ getGroup: () => n ?? "unknown",
26
+ setCustomGroups: (r, e) => {
27
+ if (r)
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(e), typeof a == "string" && D(n, a, {
33
+ ) && s(a), typeof i == "string" && $(e, i, {
34
34
  nocomment: !0
35
- }) && s(e);
35
+ }) && s(a);
36
36
  },
37
37
  defineGroup: s
38
38
  };
39
- }, O = (r, l, s) => {
40
- var e, a;
41
- if ((e = l.dependencies) != null && e.includes(r.name))
39
+ }, S = (t, n, s) => {
40
+ var a, i;
41
+ if ((a = n.dependencies) != null && a.includes(t.name))
42
42
  return -1;
43
- if ((a = r.dependencies) != null && a.includes(l.name))
43
+ if ((i = t.dependencies) != null && i.includes(n.name))
44
44
  return 1;
45
- let t = s.order === "asc" ? 1 : -1, u, n = (i) => s["ignore-case"] ? i.toLowerCase() : i;
46
- return s.type === p.alphabetical ? u = (i, o) => n(i.name).localeCompare(n(o.name)) : s.type === p.natural ? u = (i, o) => ce(n(i.name), n(o.name)) : u = (i, o) => {
47
- let c = i.size, y = o.size, h = s["max-line-length"];
48
- if (h) {
49
- let f = (g, m) => g > h && m.hasMultipleImportDeclarations;
50
- f(c, i) && (c = i.name.length + 10), f(y, o) && (y = o.name.length + 10);
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) => {
47
+ let y = o.size, m = u.size, c = s["max-line-length"];
48
+ if (c) {
49
+ let d = (f, b) => f > c && b.hasMultipleImportDeclarations;
50
+ d(y, o) && (y = o.name.length + 10), d(m, u) && (m = u.name.length + 10);
51
51
  }
52
- return c - y;
53
- }, t * u(r, l);
54
- }, A = (r, l) => [...r].sort((s, t) => O(s, t, l)), fe = (r, l) => {
55
- let s = l.getTokenAfter(r, {
56
- filter: ({ value: t, type: u }) => !(u === "Punctuator" && [",", ";"].includes(t)),
52
+ return y - m;
53
+ }, l * r(t, n);
54
+ }, w = (t, n) => [...t].sort((s, l) => S(s, l, n)), ce = (t, n) => {
55
+ let s = n.getTokenAfter(t, {
56
+ filter: ({ value: l, type: r }) => !(r === "Punctuator" && [",", ";"].includes(l)),
57
57
  includeComments: !0
58
58
  });
59
- return ((s == null ? void 0 : s.type) === "Block" || (s == null ? void 0 : s.type) === "Line") && r.loc.end.line === s.loc.end.line ? s : null;
60
- }, pe = (r, l) => Array.isArray(r) && r.some(
61
- (s) => D(l.trim(), s, {
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(
61
+ (s) => $(n.trim(), s, {
62
62
  nocomment: !0
63
63
  })
64
- ) || typeof r == "string" && D(l.trim(), r, {
64
+ ) || typeof t == "string" && $(n.trim(), t, {
65
65
  nocomment: !0
66
- }) || r === !0, J = (r, l) => {
67
- let [s, t] = l.getTokensBefore(r, {
68
- filter: ({ value: u, type: n }) => !(n === "Punctuator" && [",", ";"].includes(u)),
66
+ }) || t === !0, V = (t, n) => {
67
+ let [s, l] = n.getTokensBefore(t, {
68
+ filter: ({ value: r, type: e }) => !(e === "Punctuator" && [",", ";"].includes(r)),
69
69
  includeComments: !0,
70
70
  count: 2
71
71
  });
72
- return ((t == null ? void 0 : t.type) === "Block" || (t == null ? void 0 : t.type) === "Line") && r.loc.start.line - t.loc.end.line <= 1 && (s == null ? void 0 : s.loc.end.line) !== t.loc.start.line ? t : null;
73
- }, M = (r, l, s) => {
74
- var a;
75
- let t = r.range.at(0), u = r.range.at(1), n = l.text.slice(t, u);
76
- if (W.isParenthesized(r, l)) {
77
- let i = l.getTokenBefore(
78
- r,
79
- W.isOpeningParenToken
80
- ), o = l.getTokenAfter(
81
- r,
82
- W.isClosingParenToken
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, 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 (_.isParenthesized(t, n)) {
77
+ let o = n.getTokenBefore(
78
+ t,
79
+ _.isOpeningParenToken
80
+ ), u = n.getTokenAfter(
81
+ t,
82
+ _.isClosingParenToken
83
83
  );
84
- t = i.range.at(0), u = o.range.at(1);
84
+ l = o.range.at(0), r = u.range.at(1);
85
85
  }
86
- let e = J(r, l);
87
- if (n.endsWith(";") || n.endsWith(",")) {
88
- let i = l.getTokensAfter(r, {
86
+ let a = V(t, n);
87
+ if (e.endsWith(";") || e.endsWith(",")) {
88
+ let o = n.getTokensAfter(t, {
89
89
  includeComments: !0,
90
90
  count: 2
91
91
  });
92
- r.loc.start.line === ((a = i.at(1)) == null ? void 0 : a.loc.start.line) && (u -= 1);
92
+ t.loc.start.line === ((i = o.at(1)) == null ? void 0 : i.loc.start.line) && (r -= 1);
93
93
  }
94
- return e && !pe(
94
+ return a && !ie(
95
95
  (s == null ? void 0 : s.partitionComment) ?? !1,
96
- e.value
97
- ) && (t = e.range.at(0)), [t, u];
98
- }, T = (r, l, s, t, u) => {
99
- var a, i;
100
- let n = [], e = ((a = l.at(0)) == null ? void 0 : a.node.loc.start.line) === ((i = l.at(-1)) == null ? void 0 : i.node.loc.end.line);
101
- for (let o = 0, c = l.length; o < c; o++) {
102
- let { node: y } = l.at(o);
103
- n.push(
104
- r.replaceTextRange(
105
- M(y, t, u),
106
- t.text.slice(
107
- ...M(s.at(o).node, t, u)
96
+ a.value
97
+ ) && (l = a.range.at(0)), [l, r];
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
+ e.push(
104
+ t.replaceTextRange(
105
+ T(m, l, r),
106
+ l.text.slice(
107
+ ...T(s.at(u).node, l, r)
108
108
  )
109
109
  )
110
110
  );
111
- let h = fe(s.at(o).node, t);
112
- if (h && !e) {
113
- let g = [
114
- t.getTokenBefore(h).range.at(1),
115
- h.range.at(1)
111
+ let c = ce(s.at(u).node, l);
112
+ if (c && !a) {
113
+ let f = [
114
+ l.getTokenBefore(c).range.at(1),
115
+ c.range.at(1)
116
116
  ];
117
- n.push(r.replaceTextRange(g, ""));
118
- let m = t.getTokenAfter(y);
119
- n.push(
120
- r.insertTextAfter(
121
- (m == null ? void 0 : m.loc.end.line) === y.loc.end.line ? m : y,
122
- t.text.slice(...g)
117
+ e.push(t.replaceTextRange(f, ""));
118
+ let b = l.getTokenAfter(m);
119
+ e.push(
120
+ t.insertTextAfter(
121
+ (b == null ? void 0 : b.loc.end.line) === m.loc.end.line ? b : m,
122
+ l.text.slice(...f)
123
123
  )
124
124
  );
125
125
  }
126
126
  }
127
- return n;
128
- }, C = (r = {}, l) => Object.assign(l, r), P = (r, l) => {
129
- if (r.length > 1)
130
- for (let s = 1; s < r.length; s++) {
131
- let t = r.at(s - 1), u = r.at(s);
132
- t && u && l(t, u, s - 1);
127
+ return e;
128
+ }, j = (t = {}, n) => Object.assign(n, t), k = (t, n) => {
129
+ if (t.length > 1)
130
+ for (let s = 1; s < t.length; s++) {
131
+ let l = t.at(s - 1), r = t.at(s);
132
+ l && r && n(l, r, s - 1);
133
133
  }
134
134
  };
135
- const X = "sort-svelte-attributes", ge = j({
136
- name: X,
135
+ const J = "sort-svelte-attributes", fe = O({
136
+ name: J,
137
137
  meta: {
138
138
  type: "suggestion",
139
139
  docs: {
@@ -157,8 +157,8 @@ const X = "sort-svelte-attributes", ge = j({
157
157
  type: "string"
158
158
  },
159
159
  order: {
160
- enum: [d.asc, d.desc],
161
- default: d.asc,
160
+ enum: [g.asc, g.desc],
161
+ default: g.asc,
162
162
  type: "string"
163
163
  },
164
164
  "ignore-case": {
@@ -179,65 +179,72 @@ const X = "sort-svelte-attributes", ge = j({
179
179
  defaultOptions: [
180
180
  {
181
181
  type: p.alphabetical,
182
- order: d.asc
182
+ order: g.asc
183
183
  }
184
184
  ],
185
- create: (r) => _.extname(r.getFilename()) !== ".svelte" ? {} : {
186
- SvelteStartTag: (l) => {
187
- if (l.attributes.length > 1) {
188
- let s = C(r.options.at(0), {
185
+ create: (t) => B.extname(t.filename) !== ".svelte" ? {} : {
186
+ SvelteStartTag: (n) => {
187
+ if (n.attributes.length > 1) {
188
+ let s = j(t.options.at(0), {
189
189
  type: p.alphabetical,
190
- order: d.asc,
190
+ order: g.asc,
191
191
  "ignore-case": !1,
192
192
  "custom-groups": {},
193
193
  groups: []
194
- }), t = r.getSourceCode(), u = l.attributes.reduce(
195
- (n, e) => {
194
+ }), l = n.attributes.reduce(
195
+ (r, e) => {
196
196
  if (e.type === "SvelteSpreadAttribute")
197
- return n.push([]), n;
198
- let a, { getGroup: i, defineGroup: o, setCustomGroups: c } = R(
197
+ return r.push([]), r;
198
+ let a, { getGroup: i, defineGroup: o, setCustomGroups: u } = G(
199
199
  s.groups
200
200
  );
201
- return e.key.type === "SvelteSpecialDirectiveKey" ? a = t.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: a } = e.key : a = t.text.slice(...e.key.range), c(s["custom-groups"], a), e.type === "SvelteShorthandAttribute" && (o("svelte-shorthand"), o("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline"), n.at(-1).push({
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: v(e.range),
203
203
  node: e,
204
204
  group: i(),
205
205
  name: a
206
- }), n;
206
+ }), r;
207
207
  },
208
208
  [[]]
209
209
  );
210
- for (let n of u)
211
- P(n, (e, a) => {
210
+ for (let r of l)
211
+ k(r, (e, a) => {
212
212
  let i = x(s.groups, e), o = x(s.groups, a);
213
- (i > o || i === o && k(O(e, a, s))) && r.report({
213
+ (i > o || i === o && I(S(e, a, s))) && t.report({
214
214
  messageId: "unexpectedSvelteAttributesOrder",
215
215
  data: {
216
216
  left: e.name,
217
217
  right: a.name
218
218
  },
219
219
  node: a.node,
220
- fix: (c) => {
220
+ fix: (u) => {
221
221
  let y = {};
222
- for (let f of n) {
223
- let g = x(s.groups, f);
224
- g in y ? y[g] = A(
225
- [...y[g], f],
222
+ for (let c of r) {
223
+ let d = x(s.groups, c);
224
+ d in y ? y[d] = w(
225
+ [...y[d], c],
226
226
  s
227
- ) : y[g] = [f];
227
+ ) : y[d] = [c];
228
228
  }
229
- let h = [];
230
- for (let f of Object.keys(y).sort())
231
- h.push(...A(y[f], s));
232
- return T(c, n, h, t);
229
+ let m = [];
230
+ for (let c of Object.keys(y).sort(
231
+ (d, f) => Number(d) - Number(f)
232
+ ))
233
+ m.push(...w(y[c], s));
234
+ return L(
235
+ u,
236
+ r,
237
+ m,
238
+ t.sourceCode
239
+ );
233
240
  }
234
241
  });
235
242
  });
236
243
  }
237
244
  }
238
245
  }
239
- }), q = "sort-astro-attributes", ye = j({
240
- name: q,
246
+ }), X = "sort-astro-attributes", ge = O({
247
+ name: X,
241
248
  meta: {
242
249
  type: "suggestion",
243
250
  docs: {
@@ -261,8 +268,8 @@ const X = "sort-svelte-attributes", ge = j({
261
268
  type: "string"
262
269
  },
263
270
  order: {
264
- enum: [d.asc, d.desc],
265
- default: d.asc,
271
+ enum: [g.asc, g.desc],
272
+ default: g.asc,
266
273
  type: "string"
267
274
  },
268
275
  "ignore-case": {
@@ -283,28 +290,28 @@ const X = "sort-svelte-attributes", ge = j({
283
290
  defaultOptions: [
284
291
  {
285
292
  type: p.alphabetical,
286
- order: d.asc
293
+ order: g.asc
287
294
  }
288
295
  ],
289
296
  // @ts-ignore
290
- create: (r) => _.extname(r.getFilename()) !== ".astro" ? {} : {
291
- JSXElement: (l) => {
292
- let { attributes: s } = l.openingElement;
297
+ create: (t) => B.extname(t.filename) !== ".astro" ? {} : {
298
+ JSXElement: (n) => {
299
+ let { attributes: s } = n.openingElement;
293
300
  if (s.length > 1) {
294
- let t = C(r.options.at(0), {
301
+ let l = j(t.options.at(0), {
295
302
  type: p.alphabetical,
296
- order: d.asc,
303
+ order: g.asc,
297
304
  "ignore-case": !1,
298
305
  "custom-groups": {},
299
306
  groups: []
300
- }), u = r.getSourceCode(), n = s.reduce(
307
+ }), r = s.reduce(
301
308
  (e, a) => {
302
309
  if (a.type === "JSXSpreadAttribute")
303
310
  return e.push([]), e;
304
- let i = typeof a.name.name == "string" ? a.name.name : u.text.slice(...a.name.range), { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
305
- t.groups
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(
312
+ l.groups
306
313
  );
307
- return y(t["custom-groups"], i), a.type === "AstroShorthandAttribute" && (c("astro-shorthand"), c("shorthand")), a.value === null && c("shorthand"), a.loc.start.line !== a.loc.end.line && c("multiline"), e.at(-1).push({
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({
308
315
  size: v(a.range),
309
316
  node: a,
310
317
  group: o(),
@@ -313,10 +320,10 @@ const X = "sort-svelte-attributes", ge = j({
313
320
  },
314
321
  [[]]
315
322
  );
316
- for (let e of n)
317
- P(e, (a, i) => {
318
- let o = x(t.groups, a), c = x(t.groups, i);
319
- (o > c || o === c && k(O(a, i, t))) && r.report({
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({
320
327
  messageId: "unexpectedAstroAttributesOrder",
321
328
  data: {
322
329
  left: a.name,
@@ -324,18 +331,25 @@ const X = "sort-svelte-attributes", ge = j({
324
331
  },
325
332
  node: i.node,
326
333
  fix: (y) => {
327
- let h = {};
328
- for (let g of e) {
329
- let m = x(t.groups, g);
330
- m in h ? h[m] = A(
331
- [...h[m], g],
332
- t
333
- ) : h[m] = [g];
334
+ let m = {};
335
+ for (let d of e) {
336
+ let f = x(l.groups, d);
337
+ f in m ? m[f] = w(
338
+ [...m[f], d],
339
+ l
340
+ ) : m[f] = [d];
334
341
  }
335
- let f = [];
336
- for (let g of Object.keys(h).sort())
337
- f.push(...A(h[g], t));
338
- return T(y, e, f, u);
342
+ let c = [];
343
+ for (let d of Object.keys(m).sort(
344
+ (f, b) => Number(f) - Number(b)
345
+ ))
346
+ c.push(...w(m[d], l));
347
+ return L(
348
+ y,
349
+ e,
350
+ c,
351
+ t.sourceCode
352
+ );
339
353
  }
340
354
  });
341
355
  });
@@ -343,9 +357,9 @@ const X = "sort-svelte-attributes", ge = j({
343
357
  }
344
358
  }
345
359
  });
346
- let I = (r) => r.replaceAll(/\s\s+/g, " ").trim();
347
- const K = "sort-array-includes", me = j({
348
- name: K,
360
+ let A = (t) => t.replaceAll(/\s\s+/g, " ").trim();
361
+ const q = "sort-array-includes", ye = O({
362
+ name: q,
349
363
  meta: {
350
364
  type: "suggestion",
351
365
  docs: {
@@ -366,8 +380,8 @@ const K = "sort-array-includes", me = j({
366
380
  type: "string"
367
381
  },
368
382
  order: {
369
- enum: [d.asc, d.desc],
370
- default: d.asc,
383
+ enum: [g.asc, g.desc],
384
+ default: g.asc,
371
385
  type: "string"
372
386
  },
373
387
  "ignore-case": {
@@ -389,43 +403,48 @@ const K = "sort-array-includes", me = j({
389
403
  defaultOptions: [
390
404
  {
391
405
  type: p.alphabetical,
392
- order: d.asc
406
+ order: g.asc
393
407
  }
394
408
  ],
395
- create: (r) => ({
396
- MemberExpression: (l) => {
397
- if ((l.object.type === "ArrayExpression" || l.object.type === "NewExpression") && l.property.type === "Identifier" && l.property.name === "includes") {
398
- let s = l.object.type === "ArrayExpression" ? l.object.elements : l.object.arguments;
409
+ create: (t) => ({
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;
399
413
  if (s.length > 1) {
400
- let t = C(r.options.at(0), {
414
+ let l = j(t.options.at(0), {
401
415
  type: p.alphabetical,
402
- order: d.asc,
416
+ order: g.asc,
403
417
  "ignore-case": !1,
404
418
  "spread-last": !1
405
- }), u = r.getSourceCode(), n = s.reduce(
419
+ }), r = s.reduce(
406
420
  (e, a) => (a !== null && e.at(0).push({
407
- name: a.type === "Literal" ? `${a.value}` : u.text.slice(...a.range),
421
+ name: a.type === "Literal" ? `${a.value}` : t.sourceCode.text.slice(...a.range),
408
422
  size: v(a.range),
409
423
  type: a.type,
410
424
  node: a
411
425
  }), e),
412
426
  [[], []]
413
427
  ).flat();
414
- P(n, (e, a) => {
428
+ k(r, (e, a) => {
415
429
  let i;
416
- t["spread-last"] && e.node.type === "Literal" && a.node.type === "SpreadElement" ? i = !1 : t["spread-last"] && e.node.type === "SpreadElement" && a.node.type === "Literal" ? i = !0 : i = k(O(e, a, t)), i && r.report({
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({
417
431
  messageId: "unexpectedArrayIncludesOrder",
418
432
  data: {
419
- left: I(e.name),
420
- right: I(a.name)
433
+ left: A(e.name),
434
+ right: A(a.name)
421
435
  },
422
436
  node: a.node,
423
437
  fix: (o) => {
424
- let c = A(n, t);
425
- if (t["spread-last"])
426
- for (let y = 0, h = c.length; y < h; y++)
427
- c.at(y).node.type === "SpreadElement" && c.push(c.splice(y, 1).at(0));
428
- return T(o, n, c, u);
438
+ let u = w(r, l);
439
+ if (l["spread-last"])
440
+ for (let y = 0, m = u.length; y < m; y++)
441
+ u.at(y).node.type === "SpreadElement" && u.push(u.splice(y, 1).at(0));
442
+ return L(
443
+ o,
444
+ r,
445
+ u,
446
+ t.sourceCode
447
+ );
429
448
  }
430
449
  });
431
450
  });
@@ -433,8 +452,8 @@ const K = "sort-array-includes", me = j({
433
452
  }
434
453
  }
435
454
  })
436
- }), F = "sort-vue-attributes", he = j({
437
- name: F,
455
+ }), K = "sort-vue-attributes", me = O({
456
+ name: K,
438
457
  meta: {
439
458
  type: "suggestion",
440
459
  docs: {
@@ -458,8 +477,8 @@ const K = "sort-array-includes", me = j({
458
477
  type: "string"
459
478
  },
460
479
  order: {
461
- enum: [d.asc, d.desc],
462
- default: d.asc,
480
+ enum: [g.asc, g.desc],
481
+ default: g.asc,
463
482
  type: "string"
464
483
  },
465
484
  "ignore-case": {
@@ -481,32 +500,32 @@ const K = "sort-array-includes", me = j({
481
500
  defaultOptions: [
482
501
  {
483
502
  type: p.alphabetical,
484
- order: d.asc
503
+ order: g.asc
485
504
  }
486
505
  ],
487
- create: (r) => {
488
- if (_.extname(r.getFilename()) !== ".vue")
506
+ create: (t) => {
507
+ if (B.extname(t.filename) !== ".vue")
489
508
  return {};
490
- if (!("defineTemplateBodyVisitor" in r.parserServices))
509
+ if (!("defineTemplateBodyVisitor" in t.sourceCode.parserServices))
491
510
  return {};
492
- let { defineTemplateBodyVisitor: l } = r.parserServices;
493
- return l({
511
+ let { defineTemplateBodyVisitor: n } = t.sourceCode.parserServices;
512
+ return n({
494
513
  VStartTag: (s) => {
495
514
  if (s.attributes.length > 1) {
496
- let t = C(r.options.at(0), {
515
+ let l = j(t.options.at(0), {
497
516
  type: p.alphabetical,
498
- order: d.asc,
517
+ order: g.asc,
499
518
  "ignore-case": !1,
500
519
  "custom-groups": {},
501
520
  groups: []
502
- }), u = r.getSourceCode(), n = s.attributes.reduce(
521
+ }), r = s.attributes.reduce(
503
522
  (e, a) => {
504
523
  if (a.key.type === "VDirectiveKey" && a.key.name.rawName === "bind")
505
524
  return e.push([]), e;
506
- let i, { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
507
- t.groups
525
+ let i, { getGroup: o, defineGroup: u, setCustomGroups: y } = G(
526
+ l.groups
508
527
  );
509
- return typeof a.key.name == "string" && a.key.type !== "VDirectiveKey" ? i = a.key.rawName : i = u.text.slice(...a.key.range), y(t["custom-groups"], i), a.value === null && c("shorthand"), a.loc.start.line !== a.loc.end.line && c("multiline"), e.at(-1).push({
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({
510
529
  size: v(a.range),
511
530
  node: a,
512
531
  group: o(),
@@ -515,10 +534,10 @@ const K = "sort-array-includes", me = j({
515
534
  },
516
535
  [[]]
517
536
  );
518
- for (let e of n)
519
- P(e, (a, i) => {
520
- let o = x(t.groups, a), c = x(t.groups, i);
521
- (o > c || o === c && k(O(a, i, t))) && r.report({
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({
522
541
  messageId: "unexpectedVueAttributesOrder",
523
542
  data: {
524
543
  left: a.name,
@@ -526,18 +545,25 @@ const K = "sort-array-includes", me = j({
526
545
  },
527
546
  node: i.node,
528
547
  fix: (y) => {
529
- let h = {};
530
- for (let g of e) {
531
- let m = x(t.groups, g);
532
- m in h ? h[m] = A(
533
- [...h[m], g],
534
- t
535
- ) : h[m] = [g];
548
+ let m = {};
549
+ for (let d of e) {
550
+ let f = x(l.groups, d);
551
+ f in m ? m[f] = w(
552
+ [...m[f], d],
553
+ l
554
+ ) : m[f] = [d];
536
555
  }
537
- let f = [];
538
- for (let g of Object.keys(h).sort())
539
- f.push(...A(h[g], t));
540
- return T(y, e, f, u);
556
+ let c = [];
557
+ for (let d of Object.keys(m).sort(
558
+ (f, b) => Number(f) - Number(b)
559
+ ))
560
+ c.push(...w(m[d], l));
561
+ return L(
562
+ y,
563
+ e,
564
+ c,
565
+ t.sourceCode
566
+ );
541
567
  }
542
568
  });
543
569
  });
@@ -545,7 +571,7 @@ const K = "sort-array-includes", me = j({
545
571
  }
546
572
  });
547
573
  }
548
- }), H = "sort-named-exports", be = j({
574
+ }), H = "sort-named-exports", he = O({
549
575
  name: H,
550
576
  meta: {
551
577
  type: "suggestion",
@@ -567,8 +593,8 @@ const K = "sort-array-includes", me = j({
567
593
  type: "string"
568
594
  },
569
595
  order: {
570
- enum: [d.asc, d.desc],
571
- default: d.asc,
596
+ enum: [g.asc, g.desc],
597
+ default: g.asc,
572
598
  type: "string"
573
599
  },
574
600
  "ignore-case": {
@@ -586,36 +612,41 @@ const K = "sort-array-includes", me = j({
586
612
  defaultOptions: [
587
613
  {
588
614
  type: p.alphabetical,
589
- order: d.asc
615
+ order: g.asc
590
616
  }
591
617
  ],
592
- create: (r) => ({
593
- ExportNamedDeclaration: (l) => {
594
- if (l.specifiers.length > 1) {
595
- let s = C(r.options.at(0), {
618
+ create: (t) => ({
619
+ ExportNamedDeclaration: (n) => {
620
+ if (n.specifiers.length > 1) {
621
+ let s = j(t.options.at(0), {
596
622
  type: p.alphabetical,
597
623
  "ignore-case": !1,
598
- order: d.asc
599
- }), t = r.getSourceCode(), u = l.specifiers.map((n) => ({
600
- size: v(n.range),
601
- name: n.local.name,
602
- node: n
624
+ order: g.asc
625
+ }), l = n.specifiers.map((r) => ({
626
+ size: v(r.range),
627
+ name: r.local.name,
628
+ node: r
603
629
  }));
604
- P(u, (n, e) => {
605
- k(O(n, e, s)) && r.report({
630
+ k(l, (r, e) => {
631
+ I(S(r, e, s)) && t.report({
606
632
  messageId: "unexpectedNamedExportsOrder",
607
633
  data: {
608
- left: n.name,
634
+ left: r.name,
609
635
  right: e.name
610
636
  },
611
637
  node: e.node,
612
- fix: (a) => T(a, u, A(u, s), t)
638
+ fix: (a) => L(
639
+ a,
640
+ l,
641
+ w(l, s),
642
+ t.sourceCode
643
+ )
613
644
  });
614
645
  });
615
646
  }
616
647
  }
617
648
  })
618
- }), Q = "sort-named-imports", xe = j({
649
+ }), Q = "sort-named-imports", be = O({
619
650
  name: Q,
620
651
  meta: {
621
652
  type: "suggestion",
@@ -637,8 +668,8 @@ const K = "sort-array-includes", me = j({
637
668
  type: "string"
638
669
  },
639
670
  order: {
640
- enum: [d.asc, d.desc],
641
- default: d.asc,
671
+ enum: [g.asc, g.desc],
672
+ default: g.asc,
642
673
  type: "string"
643
674
  },
644
675
  "ignore-case": {
@@ -660,48 +691,53 @@ const K = "sort-array-includes", me = j({
660
691
  defaultOptions: [
661
692
  {
662
693
  type: p.alphabetical,
663
- order: d.asc
694
+ order: g.asc
664
695
  }
665
696
  ],
666
- create: (r) => ({
667
- ImportDeclaration: (l) => {
668
- let s = l.specifiers.filter(
669
- ({ type: t }) => t === "ImportSpecifier"
697
+ create: (t) => ({
698
+ ImportDeclaration: (n) => {
699
+ let s = n.specifiers.filter(
700
+ ({ type: l }) => l === "ImportSpecifier"
670
701
  );
671
702
  if (s.length > 1) {
672
- let t = C(r.options.at(0), {
703
+ let l = j(t.options.at(0), {
673
704
  type: p.alphabetical,
674
705
  "ignore-alias": !0,
675
706
  "ignore-case": !1,
676
- order: d.asc
677
- }), u = r.getSourceCode(), n = s.map((e) => {
707
+ order: g.asc
708
+ }), r = s.map((e) => {
678
709
  let { name: a } = e.local;
679
- return t["ignore-alias"] && e.type === "ImportSpecifier" && ({ name: a } = e.imported), {
710
+ return l["ignore-alias"] && e.type === "ImportSpecifier" && ({ name: a } = e.imported), {
680
711
  size: v(e.range),
681
712
  node: e,
682
713
  name: a
683
714
  };
684
715
  });
685
- P(n, (e, a) => {
686
- k(O(e, a, t)) && r.report({
716
+ k(r, (e, a) => {
717
+ I(S(e, a, l)) && t.report({
687
718
  messageId: "unexpectedNamedImportsOrder",
688
719
  data: {
689
720
  left: e.name,
690
721
  right: a.name
691
722
  },
692
723
  node: a.node,
693
- fix: (i) => T(i, n, A(n, t), u)
724
+ fix: (i) => L(
725
+ i,
726
+ r,
727
+ w(r, l),
728
+ t.sourceCode
729
+ )
694
730
  });
695
731
  });
696
732
  }
697
733
  }
698
734
  })
699
735
  });
700
- let B = (r, l, s) => r.lines.slice(
701
- l.node.loc.end.line,
736
+ let z = (t, n, s) => t.lines.slice(
737
+ n.node.loc.end.line,
702
738
  s.node.loc.start.line - 1
703
- ).filter((u) => !u.trim().length).length;
704
- const Y = "sort-object-types", Ee = j({
739
+ ).filter((r) => !r.trim().length).length;
740
+ const Y = "sort-object-types", xe = O({
705
741
  name: Y,
706
742
  meta: {
707
743
  type: "suggestion",
@@ -726,8 +762,8 @@ const Y = "sort-object-types", Ee = j({
726
762
  type: "string"
727
763
  },
728
764
  order: {
729
- enum: [d.asc, d.desc],
730
- default: d.asc,
765
+ enum: [g.asc, g.desc],
766
+ default: g.asc,
731
767
  type: "string"
732
768
  },
733
769
  "ignore-case": {
@@ -753,80 +789,95 @@ const Y = "sort-object-types", Ee = j({
753
789
  defaultOptions: [
754
790
  {
755
791
  type: p.alphabetical,
756
- order: d.asc
792
+ order: g.asc
757
793
  }
758
794
  ],
759
- create: (r) => ({
760
- TSTypeLiteral: (l) => {
761
- if (l.members.length > 1) {
762
- let s = C(r.options.at(0), {
795
+ create: (t) => ({
796
+ TSTypeLiteral: (n) => {
797
+ if (n.members.length > 1) {
798
+ let s = j(t.options.at(0), {
763
799
  "partition-by-new-line": !1,
764
800
  type: p.alphabetical,
765
801
  "ignore-case": !1,
766
- order: d.asc,
802
+ order: g.asc,
767
803
  "custom-groups": {},
768
804
  groups: []
769
- }), t = r.getSourceCode(), u = l.members.reduce(
770
- (n, e) => {
771
- var E, b, N, S;
772
- let a, i = t.text.slice(e.range.at(0), e.range.at(1)), o = (E = n.at(-1)) == null ? void 0 : E.at(-1), { getGroup: c, defineGroup: y, setCustomGroups: h } = R(
805
+ }), l = n.members.reduce(
806
+ (r, e) => {
807
+ var E, h, C, N;
808
+ let a, i = t.sourceCode.text.slice(
809
+ e.range.at(0),
810
+ e.range.at(1)
811
+ ), o = (E = r.at(-1)) == null ? void 0 : E.at(-1), { getGroup: u, defineGroup: y, setCustomGroups: m } = G(
773
812
  s.groups
774
- ), f = (L) => L.replace(/(,|;)$/, "");
813
+ ), c = (P) => P.replace(/(,|;)$/, "");
775
814
  if (e.type === "TSPropertySignature")
776
- e.key.type === "Identifier" ? { name: a } = e.key : e.key.type === "Literal" ? a = `${e.key.value}` : a = t.text.slice(
815
+ e.key.type === "Identifier" ? { name: a } = e.key : e.key.type === "Literal" ? a = `${e.key.value}` : a = t.sourceCode.text.slice(
777
816
  e.range.at(0),
778
- (b = e.typeAnnotation) == null ? void 0 : b.range.at(0)
817
+ (h = e.typeAnnotation) == null ? void 0 : h.range.at(0)
779
818
  );
780
819
  else if (e.type === "TSIndexSignature") {
781
- let L = ((N = e.typeAnnotation) == null ? void 0 : N.range.at(0)) ?? e.range.at(1);
782
- a = f(t.text.slice(e.range.at(0), L));
820
+ let P = ((C = e.typeAnnotation) == null ? void 0 : C.range.at(0)) ?? e.range.at(1);
821
+ a = c(
822
+ t.sourceCode.text.slice(e.range.at(0), P)
823
+ );
783
824
  } else
784
- a = f(
785
- t.text.slice(e.range.at(0), e.range.at(1))
825
+ a = c(
826
+ t.sourceCode.text.slice(
827
+ e.range.at(0),
828
+ e.range.at(1)
829
+ )
786
830
  );
787
- h(s["custom-groups"], a), e.loc.start.line !== e.loc.end.line && y("multiline");
788
- let m = i.endsWith(";") || i.endsWith(",") ? 1 : 0, w = {
789
- size: v(e.range) - m,
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,
790
834
  node: e,
791
835
  name: a
792
836
  };
793
- return s["partition-by-new-line"] && o && B(t, o, w) && n.push([]), (S = n.at(-1)) == null || S.push({
794
- ...w,
795
- group: c()
796
- }), n;
837
+ return s["partition-by-new-line"] && o && z(t.sourceCode, o, b) && r.push([]), (N = r.at(-1)) == null || N.push({
838
+ ...b,
839
+ group: u()
840
+ }), r;
797
841
  },
798
842
  [[]]
799
843
  );
800
- for (let n of u)
801
- P(n, (e, a) => {
844
+ for (let r of l)
845
+ k(r, (e, a) => {
802
846
  let i = x(s.groups, e), o = x(s.groups, a);
803
- (i > o || i === o && k(O(e, a, s))) && r.report({
847
+ (i > o || i === o && I(S(e, a, s))) && t.report({
804
848
  messageId: "unexpectedObjectTypesOrder",
805
849
  data: {
806
- left: I(e.name),
807
- right: I(a.name)
850
+ left: A(e.name),
851
+ right: A(a.name)
808
852
  },
809
853
  node: a.node,
810
- fix: (c) => {
854
+ fix: (u) => {
811
855
  let y = {};
812
- for (let f of n) {
813
- let g = x(s.groups, f);
814
- g in y ? y[g] = A(
815
- [...y[g], f],
856
+ for (let c of r) {
857
+ let d = x(s.groups, c);
858
+ d in y ? y[d] = w(
859
+ [...y[d], c],
816
860
  s
817
- ) : y[g] = [f];
861
+ ) : y[d] = [c];
818
862
  }
819
- let h = [];
820
- for (let f of Object.keys(y).sort())
821
- h.push(...A(y[f], s));
822
- return T(c, n, h, t);
863
+ let m = [];
864
+ for (let c of Object.keys(y).sort(
865
+ (d, f) => Number(d) - Number(f)
866
+ ))
867
+ m.push(...w(y[c], s));
868
+ return L(
869
+ u,
870
+ r,
871
+ m,
872
+ t.sourceCode
873
+ );
823
874
  }
824
875
  });
825
876
  });
826
877
  }
827
878
  }
828
879
  })
829
- }), Z = "sort-union-types", Se = j({
880
+ }), Z = "sort-union-types", Ee = O({
830
881
  name: Z,
831
882
  meta: {
832
883
  type: "suggestion",
@@ -848,8 +899,8 @@ const Y = "sort-object-types", Ee = j({
848
899
  type: "string"
849
900
  },
850
901
  order: {
851
- enum: [d.asc, d.desc],
852
- default: d.asc,
902
+ enum: [g.asc, g.desc],
903
+ default: g.asc,
853
904
  type: "string"
854
905
  },
855
906
  "ignore-case": {
@@ -871,49 +922,49 @@ const Y = "sort-object-types", Ee = j({
871
922
  defaultOptions: [
872
923
  {
873
924
  type: p.alphabetical,
874
- order: d.asc
925
+ order: g.asc
875
926
  }
876
927
  ],
877
- create: (r) => ({
878
- TSUnionType: (l) => {
879
- let s = r.getSourceCode(), t = C(r.options.at(0), {
928
+ create: (t) => ({
929
+ TSUnionType: (n) => {
930
+ let s = j(t.options.at(0), {
880
931
  type: p.alphabetical,
881
932
  "nullable-last": !1,
882
933
  "ignore-case": !1,
883
- order: d.asc
884
- }), u = l.types.map((n) => ({
885
- group: n.type === "TSNullKeyword" || n.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
886
- name: s.text.slice(...n.range),
887
- size: v(n.range),
888
- node: n
934
+ order: g.asc
935
+ }), l = n.types.map((r) => ({
936
+ group: r.type === "TSNullKeyword" || r.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
937
+ name: t.sourceCode.text.slice(...r.range),
938
+ size: v(r.range),
939
+ node: r
889
940
  }));
890
- P(u, (n, e) => {
891
- let a = k(O(n, e, t));
892
- t["nullable-last"] && (n.group === "nullable" && e.group === "unknown" ? a = !0 : n.group === "unknown" && e.group === "nullable" && (a = !1)), a && r.report({
941
+ k(l, (r, e) => {
942
+ let a = I(S(r, e, s));
943
+ s["nullable-last"] && (r.group === "nullable" && e.group === "unknown" ? a = !0 : r.group === "unknown" && e.group === "nullable" && (a = !1)), a && t.report({
893
944
  messageId: "unexpectedUnionTypesOrder",
894
945
  data: {
895
- left: I(n.name),
896
- right: I(e.name)
946
+ left: A(r.name),
947
+ right: A(e.name)
897
948
  },
898
949
  node: e.node,
899
950
  fix: (i) => {
900
951
  let o = [];
901
- if (t["nullable-last"]) {
902
- let c = [], y = u.filter((h) => h.group === "nullable" ? (c.push(h), !1) : !0);
952
+ if (s["nullable-last"]) {
953
+ let u = [], y = l.filter((m) => m.group === "nullable" ? (u.push(m), !1) : !0);
903
954
  o = [
904
- ...A(y, t),
905
- ...A(c, t)
955
+ ...w(y, s),
956
+ ...w(u, s)
906
957
  ];
907
958
  } else
908
- o = A(u, t);
909
- return T(i, u, o, s);
959
+ o = w(l, s);
960
+ return L(i, l, o, t.sourceCode);
910
961
  }
911
962
  });
912
963
  });
913
964
  }
914
965
  })
915
- }), ee = "sort-interfaces", we = j({
916
- name: ee,
966
+ }), F = "sort-interfaces", Ce = O({
967
+ name: F,
917
968
  meta: {
918
969
  type: "suggestion",
919
970
  docs: {
@@ -937,8 +988,8 @@ const Y = "sort-object-types", Ee = j({
937
988
  type: "string"
938
989
  },
939
990
  order: {
940
- enum: [d.asc, d.desc],
941
- default: d.asc,
991
+ enum: [g.asc, g.desc],
992
+ default: g.asc,
942
993
  type: "string"
943
994
  },
944
995
  "ignore-case": {
@@ -970,32 +1021,32 @@ const Y = "sort-object-types", Ee = j({
970
1021
  defaultOptions: [
971
1022
  {
972
1023
  type: p.alphabetical,
973
- order: d.asc
1024
+ order: g.asc
974
1025
  }
975
1026
  ],
976
- create: (r) => ({
977
- TSInterfaceDeclaration: (l) => {
978
- if (l.body.body.length > 1) {
979
- let s = C(r.options.at(0), {
1027
+ create: (t) => ({
1028
+ TSInterfaceDeclaration: (n) => {
1029
+ if (n.body.body.length > 1) {
1030
+ let s = j(t.options.at(0), {
980
1031
  "partition-by-new-line": !1,
981
1032
  type: p.alphabetical,
982
1033
  "ignore-case": !1,
983
- order: d.asc,
1034
+ order: g.asc,
984
1035
  "ignore-pattern": [],
985
1036
  "custom-groups": {},
986
1037
  groups: []
987
1038
  });
988
1039
  if (!s["ignore-pattern"].some(
989
- (t) => D(l.id.name, t, {
1040
+ (l) => $(n.id.name, l, {
990
1041
  nocomment: !0
991
1042
  })
992
1043
  )) {
993
- let t = r.getSourceCode(), u = l.body.body.reduce(
994
- (n, e) => {
995
- var f, g, m, w;
1044
+ let l = n.body.body.reduce(
1045
+ (r, e) => {
1046
+ var c, d, f, b;
996
1047
  if (e.type === "TSCallSignatureDeclaration")
997
- return n.push([]), n;
998
- let a = (f = n.at(-1)) == null ? void 0 : f.at(-1), i, { getGroup: o, defineGroup: c, setCustomGroups: y } = R(
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(
999
1050
  s.groups
1000
1051
  );
1001
1052
  if (e.type === "TSPropertySignature")
@@ -1004,51 +1055,68 @@ const Y = "sort-object-types", Ee = j({
1004
1055
  else if (e.key.type === "Literal")
1005
1056
  i = `${e.key.value}`;
1006
1057
  else {
1007
- let E = ((g = e.typeAnnotation) == null ? void 0 : g.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
1008
- i = t.text.slice(e.range.at(0), E);
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);
1009
1060
  }
1010
1061
  else if (e.type === "TSIndexSignature") {
1011
- let E = ((m = e.typeAnnotation) == null ? void 0 : m.range.at(0)) ?? e.range.at(1);
1012
- i = t.text.slice(e.range.at(0), E);
1062
+ let E = ((f = e.typeAnnotation) == null ? void 0 : f.range.at(0)) ?? e.range.at(1);
1063
+ i = t.sourceCode.text.slice(
1064
+ e.range.at(0),
1065
+ E
1066
+ );
1013
1067
  } else {
1014
- let E = ((w = e.returnType) == null ? void 0 : w.range.at(0)) ?? e.range.at(1);
1015
- i = t.text.slice(e.range.at(0), E);
1068
+ let E = ((b = e.returnType) == null ? void 0 : b.range.at(0)) ?? e.range.at(1);
1069
+ i = t.sourceCode.text.slice(
1070
+ e.range.at(0),
1071
+ E
1072
+ );
1016
1073
  }
1017
- let h = {
1074
+ let m = {
1018
1075
  size: v(e.range),
1019
1076
  node: e,
1020
1077
  name: i
1021
1078
  };
1022
- return s["partition-by-new-line"] && a && B(t, a, h) && n.push([]), y(s["custom-groups"], i), e.loc.start.line !== e.loc.end.line && c("multiline"), n.at(-1).push({
1023
- ...h,
1079
+ return s["partition-by-new-line"] && a && z(
1080
+ t.sourceCode,
1081
+ a,
1082
+ m
1083
+ ) && r.push([]), y(s["custom-groups"], i), e.loc.start.line !== e.loc.end.line && u("multiline"), r.at(-1).push({
1084
+ ...m,
1024
1085
  group: o()
1025
- }), n;
1086
+ }), r;
1026
1087
  },
1027
1088
  [[]]
1028
1089
  );
1029
- for (let n of u)
1030
- P(n, (e, a) => {
1090
+ for (let r of l)
1091
+ k(r, (e, a) => {
1031
1092
  let i = x(s.groups, e), o = x(s.groups, a);
1032
- (i > o || i === o && k(O(e, a, s))) && r.report({
1093
+ (i > o || i === o && I(S(e, a, s))) && t.report({
1033
1094
  messageId: "unexpectedInterfacePropertiesOrder",
1034
1095
  data: {
1035
- left: I(e.name),
1036
- right: I(a.name)
1096
+ left: A(e.name),
1097
+ right: A(a.name)
1037
1098
  },
1038
1099
  node: a.node,
1039
- fix: (c) => {
1100
+ fix: (u) => {
1040
1101
  let y = {};
1041
- for (let f of n) {
1042
- let g = x(s.groups, f);
1043
- g in y ? y[g] = A(
1044
- [...y[g], f],
1102
+ for (let c of r) {
1103
+ let d = x(s.groups, c);
1104
+ d in y ? y[d] = w(
1105
+ [...y[d], c],
1045
1106
  s
1046
- ) : y[g] = [f];
1107
+ ) : y[d] = [c];
1047
1108
  }
1048
- let h = [];
1049
- for (let f of Object.keys(y).sort())
1050
- h.push(...A(y[f], s));
1051
- return T(c, n, h, t);
1109
+ let m = [];
1110
+ for (let c of Object.keys(y).sort(
1111
+ (d, f) => Number(d) - Number(f)
1112
+ ))
1113
+ m.push(...w(y[c], s));
1114
+ return L(
1115
+ u,
1116
+ r,
1117
+ m,
1118
+ t.sourceCode
1119
+ );
1052
1120
  }
1053
1121
  });
1054
1122
  });
@@ -1056,8 +1124,8 @@ const Y = "sort-object-types", Ee = j({
1056
1124
  }
1057
1125
  }
1058
1126
  })
1059
- }), te = "sort-jsx-props", Ae = j({
1060
- name: te,
1127
+ }), ee = "sort-jsx-props", Ne = O({
1128
+ name: ee,
1061
1129
  meta: {
1062
1130
  type: "suggestion",
1063
1131
  docs: {
@@ -1081,8 +1149,8 @@ const Y = "sort-object-types", Ee = j({
1081
1149
  type: "string"
1082
1150
  },
1083
1151
  order: {
1084
- enum: [d.asc, d.desc],
1085
- default: d.asc,
1152
+ enum: [g.asc, g.desc],
1153
+ default: g.asc,
1086
1154
  type: "string"
1087
1155
  },
1088
1156
  groups: {
@@ -1103,69 +1171,74 @@ const Y = "sort-object-types", Ee = j({
1103
1171
  defaultOptions: [
1104
1172
  {
1105
1173
  type: p.alphabetical,
1106
- order: d.asc
1174
+ order: g.asc
1107
1175
  }
1108
1176
  ],
1109
- create: (r) => [".svelte", ".astro", ".vue"].includes(
1110
- _.extname(r.getFilename())
1111
- ) ? {} : {
1112
- JSXElement: (l) => {
1113
- if (l.openingElement.attributes.length > 1) {
1114
- let s = C(r.options.at(0), {
1177
+ create: (t) => [".svelte", ".astro", ".vue"].includes(B.extname(t.filename)) ? {} : {
1178
+ JSXElement: (n) => {
1179
+ if (n.openingElement.attributes.length > 1) {
1180
+ let s = j(t.options.at(0), {
1115
1181
  type: p.alphabetical,
1116
1182
  "ignore-case": !1,
1117
- order: d.asc,
1183
+ order: g.asc,
1118
1184
  "custom-groups": {},
1119
1185
  groups: []
1120
- }), t = r.getSourceCode(), u = l.openingElement.attributes.reduce(
1121
- (n, e) => {
1186
+ }), l = n.openingElement.attributes.reduce(
1187
+ (r, e) => {
1122
1188
  if (e.type === "JSXSpreadAttribute")
1123
- return n.push([]), n;
1124
- let a = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: i, defineGroup: o, setCustomGroups: c } = R(
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(
1125
1191
  s.groups
1126
1192
  );
1127
- c(s["custom-groups"], a), e.value === null && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline");
1193
+ u(s["custom-groups"], a), e.value === null && o("shorthand"), e.loc.start.line !== e.loc.end.line && o("multiline");
1128
1194
  let y = {
1129
1195
  size: v(e.range),
1130
1196
  group: i(),
1131
1197
  node: e,
1132
1198
  name: a
1133
1199
  };
1134
- return n.at(-1).push(y), n;
1200
+ return r.at(-1).push(y), r;
1135
1201
  },
1136
1202
  [[]]
1137
1203
  );
1138
- for (let n of u)
1139
- P(n, (e, a) => {
1204
+ for (let r of l)
1205
+ k(r, (e, a) => {
1140
1206
  let i = x(s.groups, e), o = x(s.groups, a);
1141
- (i > o || i === o && k(O(e, a, s))) && r.report({
1207
+ (i > o || i === o && I(S(e, a, s))) && t.report({
1142
1208
  messageId: "unexpectedJSXPropsOrder",
1143
1209
  data: {
1144
1210
  left: e.name,
1145
1211
  right: a.name
1146
1212
  },
1147
1213
  node: a.node,
1148
- fix: (c) => {
1214
+ fix: (u) => {
1149
1215
  let y = {};
1150
- for (let f of n) {
1151
- let g = x(s.groups, f);
1152
- g in y ? y[g] = A(
1153
- [...y[g], f],
1216
+ for (let c of r) {
1217
+ let d = x(s.groups, c);
1218
+ d in y ? y[d] = w(
1219
+ [...y[d], c],
1154
1220
  s
1155
- ) : y[g] = [f];
1221
+ ) : y[d] = [c];
1156
1222
  }
1157
- let h = [];
1158
- for (let f of Object.keys(y).sort())
1159
- h.push(...A(y[f], s));
1160
- return T(c, n, h, t);
1223
+ let m = [];
1224
+ for (let c of Object.keys(y).sort(
1225
+ (d, f) => Number(d) - Number(f)
1226
+ ))
1227
+ m.push(...w(y[c], s));
1228
+ return L(
1229
+ u,
1230
+ r,
1231
+ m,
1232
+ t.sourceCode
1233
+ );
1161
1234
  }
1162
1235
  });
1163
1236
  });
1164
1237
  }
1165
1238
  }
1166
1239
  }
1167
- }), re = "sort-exports", Ne = j({
1168
- name: re,
1240
+ }), te = "sort-exports", we = O({
1241
+ name: te,
1169
1242
  meta: {
1170
1243
  type: "suggestion",
1171
1244
  docs: {
@@ -1186,8 +1259,8 @@ const Y = "sort-object-types", Ee = j({
1186
1259
  type: "string"
1187
1260
  },
1188
1261
  order: {
1189
- enum: [d.asc, d.desc],
1190
- default: d.asc,
1262
+ enum: [g.asc, g.desc],
1263
+ default: g.asc,
1191
1264
  type: "string"
1192
1265
  },
1193
1266
  "ignore-case": {
@@ -1205,45 +1278,49 @@ const Y = "sort-object-types", Ee = j({
1205
1278
  defaultOptions: [
1206
1279
  {
1207
1280
  type: p.alphabetical,
1208
- order: d.asc
1281
+ order: g.asc
1209
1282
  }
1210
1283
  ],
1211
- create: (r) => {
1212
- let l = C(r.options.at(0), {
1284
+ create: (t) => {
1285
+ let n = j(t.options.at(0), {
1213
1286
  type: p.alphabetical,
1214
- order: d.asc,
1287
+ order: g.asc,
1215
1288
  "ignore-case": !1
1216
- }), s = [[]], t = (u) => {
1217
- u.type === "ExportAllDeclaration" && u.exported === null ? s.push([]) : s.at(-1).push({
1218
- size: v(u.range),
1219
- name: u.source.value,
1220
- node: u
1289
+ }), s = [[]], l = (r) => {
1290
+ r.type === "ExportAllDeclaration" && r.exported === null ? s.push([]) : s.at(-1).push({
1291
+ size: v(r.range),
1292
+ name: r.source.value,
1293
+ node: r
1221
1294
  });
1222
1295
  };
1223
1296
  return {
1224
- ExportAllDeclaration: t,
1225
- ExportNamedDeclaration: (u) => {
1226
- u.source !== null && t(u);
1297
+ ExportAllDeclaration: l,
1298
+ ExportNamedDeclaration: (r) => {
1299
+ r.source !== null && l(r);
1227
1300
  },
1228
1301
  "Program:exit": () => {
1229
- let u = r.getSourceCode();
1230
- for (let n of s)
1231
- P(n, (e, a) => {
1232
- k(O(e, a, l)) && r.report({
1302
+ for (let r of s)
1303
+ k(r, (e, a) => {
1304
+ I(S(e, a, n)) && t.report({
1233
1305
  messageId: "unexpectedExportsOrder",
1234
1306
  data: {
1235
1307
  left: e.name,
1236
1308
  right: a.name
1237
1309
  },
1238
1310
  node: a.node,
1239
- fix: (i) => T(i, n, A(n, l), u)
1311
+ fix: (i) => L(
1312
+ i,
1313
+ r,
1314
+ w(r, n),
1315
+ t.sourceCode
1316
+ )
1240
1317
  });
1241
1318
  });
1242
1319
  }
1243
1320
  };
1244
1321
  }
1245
- }), se = "sort-imports", Oe = j({
1246
- name: se,
1322
+ }), re = "sort-imports", Se = O({
1323
+ name: re,
1247
1324
  meta: {
1248
1325
  type: "suggestion",
1249
1326
  docs: {
@@ -1277,8 +1354,8 @@ const Y = "sort-object-types", Ee = j({
1277
1354
  type: "string"
1278
1355
  },
1279
1356
  order: {
1280
- enum: [d.asc, d.desc],
1281
- default: d.asc,
1357
+ enum: [g.asc, g.desc],
1358
+ default: g.asc,
1282
1359
  type: "string"
1283
1360
  },
1284
1361
  "ignore-case": {
@@ -1347,30 +1424,30 @@ const Y = "sort-object-types", Ee = j({
1347
1424
  defaultOptions: [
1348
1425
  {
1349
1426
  type: p.alphabetical,
1350
- order: d.asc
1427
+ order: g.asc
1351
1428
  }
1352
1429
  ],
1353
- create: (r) => {
1354
- let l = C(r.options.at(0), {
1430
+ create: (t) => {
1431
+ let n = j(t.options.at(0), {
1355
1432
  "newlines-between": "always",
1356
1433
  "custom-groups": { type: {}, value: {} },
1357
1434
  "internal-pattern": ["~/**"],
1358
1435
  type: p.alphabetical,
1359
- order: d.asc,
1436
+ order: g.asc,
1360
1437
  "ignore-case": !1,
1361
1438
  groups: []
1362
1439
  }), s = !1;
1363
- for (let o of l.groups)
1440
+ for (let o of n.groups)
1364
1441
  if (Array.isArray(o))
1365
- for (let c of o)
1366
- c === "unknown" && (s = !0);
1442
+ for (let u of o)
1443
+ u === "unknown" && (s = !0);
1367
1444
  else
1368
1445
  o === "unknown" && (s = !0);
1369
- s || (l.groups = [...l.groups, "unknown"]);
1370
- let t = r.getSourceCode(), u = [], n = (o) => o.type === "ImportDeclaration" && o.specifiers.length === 0, e = (o) => {
1371
- let c = (S) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1372
- (L) => S.endsWith(L)
1373
- ), y = (S) => [
1446
+ s || (n.groups = [...n.groups, "unknown"]);
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) => [
1374
1451
  "./index.d.js",
1375
1452
  "./index.d.ts",
1376
1453
  "./index.js",
@@ -1378,12 +1455,12 @@ const Y = "sort-object-types", Ee = j({
1378
1455
  "./index",
1379
1456
  "./",
1380
1457
  "."
1381
- ].includes(S), h = (S) => S.indexOf("..") === 0, f = (S) => S.indexOf("./") === 0, { getGroup: g, defineGroup: m, setCustomGroups: w } = R(l.groups), E = (S) => l["internal-pattern"].length && l["internal-pattern"].some(
1382
- (L) => D(S.source.value, L, {
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, {
1383
1460
  nocomment: !0
1384
1461
  })
1385
- ), b = (S) => {
1386
- let L = [
1462
+ ), h = (N) => {
1463
+ let P = [
1387
1464
  "bun",
1388
1465
  "bun:ffi",
1389
1466
  "bun:jsc",
@@ -1395,18 +1472,18 @@ const Y = "sort-object-types", Ee = j({
1395
1472
  "ws"
1396
1473
  ];
1397
1474
  return de.includes(
1398
- S.startsWith("node:") ? S.split("node:")[1] : S
1399
- ) || L.includes(S);
1400
- }, N = (S) => !(S.startsWith(".") || S.startsWith("/"));
1401
- return o.importKind === "type" && (o.type === "ImportDeclaration" && (w(l["custom-groups"].type, o.source.value), y(o.source.value) && m("index-type"), f(o.source.value) && m("sibling-type"), h(o.source.value) && m("parent-type"), E(o) && m("internal-type"), b(o.source.value) && m("builtin-type"), N(o.source.value) && m("external-type")), m("type")), o.type === "ImportDeclaration" && (w(l["custom-groups"].value, o.source.value), n(o) && m("side-effect"), c(o.source.value) && m("style"), y(o.source.value) && m("index"), f(o.source.value) && m("sibling"), h(o.source.value) && m("parent"), E(o) && m("internal"), b(o.source.value) && m("builtin"), N(o.source.value) && m("external")), g();
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();
1402
1479
  }, a = (o) => o.specifiers.length > 1, i = (o) => {
1403
- let c;
1404
- o.type === "ImportDeclaration" ? c = o.source.value : o.moduleReference.type === "TSExternalModuleReference" && o.moduleReference.expression.type === "Literal" ? c = `${o.moduleReference.expression.value}` : c = t.text.slice(...o.moduleReference.range), u.push({
1480
+ let u;
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({
1405
1482
  size: v(o.range),
1406
1483
  group: e(o),
1407
- name: c,
1484
+ name: u,
1408
1485
  node: o,
1409
- ...l.type === p["line-length"] && l["max-line-length"] && {
1486
+ ...n.type === p["line-length"] && n["max-line-length"] && {
1410
1487
  hasMultipleImportDeclarations: a(
1411
1488
  o
1412
1489
  )
@@ -1417,63 +1494,75 @@ const Y = "sort-object-types", Ee = j({
1417
1494
  TSImportEqualsDeclaration: i,
1418
1495
  ImportDeclaration: i,
1419
1496
  "Program:exit": () => {
1420
- var h;
1421
- let o = (f, g) => !!t.getTokensBetween(
1422
- f.node,
1423
- J(g.node, t) || g.node,
1497
+ var m;
1498
+ let o = (c, d) => !!t.sourceCode.getTokensBetween(
1499
+ c.node,
1500
+ V(d.node, t.sourceCode) || d.node,
1424
1501
  {
1425
1502
  includeComments: !0
1426
1503
  }
1427
- ).length, c = (f, g) => {
1428
- let m = [], w = {};
1429
- for (let b of g) {
1430
- let N = x(l.groups, b);
1431
- N in w ? w[N] = A(
1432
- [...w[N], b],
1433
- l
1434
- ) : w[N] = [b];
1504
+ ).length, u = (c, d) => {
1505
+ let f = [], b = {};
1506
+ for (let h of d) {
1507
+ let C = x(n.groups, h);
1508
+ C in b ? b[C] = w(
1509
+ [...b[C], h],
1510
+ n
1511
+ ) : b[C] = [h];
1435
1512
  }
1436
- let E = Object.keys(w).sort().reduce(
1437
- (b, N) => [
1438
- ...b,
1439
- ...w[N]
1513
+ let E = Object.keys(b).sort((h, C) => Number(h) - Number(C)).reduce(
1514
+ (h, C) => [
1515
+ ...h,
1516
+ ...b[C]
1440
1517
  ],
1441
1518
  []
1442
1519
  );
1443
- for (let b = 0, N = E.length; b < N; b++) {
1444
- let S = E.at(b);
1445
- if (m.push(
1446
- f.replaceTextRange(
1447
- M(g.at(b).node, t),
1448
- t.text.slice(...M(S.node, t))
1520
+ for (let h = 0, C = E.length; h < C; h++) {
1521
+ let N = E.at(h);
1522
+ if (f.push(
1523
+ c.replaceTextRange(
1524
+ T(d.at(h).node, t.sourceCode),
1525
+ t.sourceCode.text.slice(
1526
+ ...T(N.node, t.sourceCode)
1527
+ )
1449
1528
  )
1450
- ), l["newlines-between"] !== "ignore") {
1451
- let L = E.at(b + 1);
1452
- if (L) {
1453
- let G = B(
1454
- t,
1455
- g.at(b),
1456
- g.at(b + 1)
1529
+ ), n["newlines-between"] !== "ignore") {
1530
+ let P = E.at(h + 1);
1531
+ if (P) {
1532
+ let M = z(
1533
+ t.sourceCode,
1534
+ d.at(h),
1535
+ d.at(h + 1)
1457
1536
  );
1458
- (l["newlines-between"] === "always" && x(l.groups, S) === x(l.groups, L) && G !== 0 || l["newlines-between"] === "never" && G > 0) && m.push(
1459
- f.removeRange([
1460
- M(g.at(b).node, t).at(1),
1461
- M(g.at(b + 1).node, t).at(0) - 1
1537
+ (n["newlines-between"] === "always" && x(n.groups, N) === x(n.groups, P) && M !== 0 || n["newlines-between"] === "never" && M > 0) && f.push(
1538
+ c.removeRange([
1539
+ T(
1540
+ d.at(h).node,
1541
+ t.sourceCode
1542
+ ).at(1),
1543
+ T(
1544
+ d.at(h + 1).node,
1545
+ t.sourceCode
1546
+ ).at(0) - 1
1462
1547
  ])
1463
- ), l["newlines-between"] === "always" && x(l.groups, S) !== x(l.groups, L) && G > 1 && m.push(
1464
- f.replaceTextRange(
1548
+ ), n["newlines-between"] === "always" && x(n.groups, N) !== x(n.groups, P) && M > 1 && f.push(
1549
+ c.replaceTextRange(
1465
1550
  [
1466
- M(g.at(b).node, t).at(1),
1467
- M(g.at(b + 1).node, t).at(
1468
- 0
1469
- ) - 1
1551
+ T(
1552
+ d.at(h).node,
1553
+ t.sourceCode
1554
+ ).at(1),
1555
+ T(
1556
+ d.at(h + 1).node,
1557
+ t.sourceCode
1558
+ ).at(0) - 1
1470
1559
  ],
1471
1560
  `
1472
1561
  `
1473
1562
  )
1474
- ), l["newlines-between"] === "always" && x(l.groups, S) !== x(l.groups, L) && G === 0 && m.push(
1475
- f.insertTextAfterRange(
1476
- M(g.at(b).node, t),
1563
+ ), n["newlines-between"] === "always" && x(n.groups, N) !== x(n.groups, P) && M === 0 && f.push(
1564
+ c.insertTextAfterRange(
1565
+ T(d.at(h).node, t.sourceCode),
1477
1566
  `
1478
1567
  `
1479
1568
  )
@@ -1481,54 +1570,58 @@ const Y = "sort-object-types", Ee = j({
1481
1570
  }
1482
1571
  }
1483
1572
  }
1484
- return m;
1573
+ return f;
1485
1574
  }, y = [[]];
1486
- for (let f of u) {
1487
- let g = (h = y.at(-1)) == null ? void 0 : h.at(-1);
1488
- g && o(g, f) ? y.push([f]) : y.at(-1).push(f);
1575
+ for (let c of l) {
1576
+ let d = (m = y.at(-1)) == null ? void 0 : m.at(-1);
1577
+ d && o(d, c) ? y.push([c]) : y.at(-1).push(c);
1489
1578
  }
1490
- for (let f of y)
1491
- P(f, (g, m) => {
1492
- let w = x(l.groups, g), E = x(l.groups, m), b = B(t, g, m);
1493
- !(n(g.node) && n(m.node)) && !o(g, m) && (w > E || w === E && k(O(g, m, l))) && r.report({
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(
1582
+ t.sourceCode,
1583
+ d,
1584
+ f
1585
+ );
1586
+ !(r(d.node) && r(f.node)) && !o(d, f) && (b > E || b === E && I(S(d, f, n))) && t.report({
1494
1587
  messageId: "unexpectedImportsOrder",
1495
1588
  data: {
1496
- left: g.name,
1497
- right: m.name
1589
+ left: d.name,
1590
+ right: f.name
1498
1591
  },
1499
- node: m.node,
1500
- fix: (N) => c(N, f)
1501
- }), l["newlines-between"] === "never" && b > 0 && r.report({
1592
+ node: f.node,
1593
+ fix: (C) => u(C, c)
1594
+ }), n["newlines-between"] === "never" && h > 0 && t.report({
1502
1595
  messageId: "extraSpacingBetweenImports",
1503
1596
  data: {
1504
- left: g.name,
1505
- right: m.name
1597
+ left: d.name,
1598
+ right: f.name
1506
1599
  },
1507
- node: m.node,
1508
- fix: (N) => c(N, f)
1509
- }), l["newlines-between"] === "always" && (w < E && b === 0 ? r.report({
1600
+ node: f.node,
1601
+ fix: (C) => u(C, c)
1602
+ }), n["newlines-between"] === "always" && (b < E && h === 0 ? t.report({
1510
1603
  messageId: "missedSpacingBetweenImports",
1511
1604
  data: {
1512
- left: g.name,
1513
- right: m.name
1605
+ left: d.name,
1606
+ right: f.name
1514
1607
  },
1515
- node: m.node,
1516
- fix: (N) => c(N, f)
1517
- }) : (b > 1 || w === E && b > 0) && r.report({
1608
+ node: f.node,
1609
+ fix: (C) => u(C, c)
1610
+ }) : (h > 1 || b === E && h > 0) && t.report({
1518
1611
  messageId: "extraSpacingBetweenImports",
1519
1612
  data: {
1520
- left: g.name,
1521
- right: m.name
1613
+ left: d.name,
1614
+ right: f.name
1522
1615
  },
1523
- node: m.node,
1524
- fix: (N) => c(N, f)
1616
+ node: f.node,
1617
+ fix: (C) => u(C, c)
1525
1618
  }));
1526
1619
  });
1527
1620
  }
1528
1621
  };
1529
1622
  }
1530
- }), ae = "sort-objects", Ie = j({
1531
- name: ae,
1623
+ }), se = "sort-objects", Ae = O({
1624
+ name: se,
1532
1625
  meta: {
1533
1626
  type: "suggestion",
1534
1627
  docs: {
@@ -1564,8 +1657,8 @@ const Y = "sort-object-types", Ee = j({
1564
1657
  type: "string"
1565
1658
  },
1566
1659
  order: {
1567
- enum: [d.asc, d.desc],
1568
- default: d.asc,
1660
+ enum: [g.asc, g.desc],
1661
+ default: g.asc,
1569
1662
  type: "string"
1570
1663
  },
1571
1664
  "ignore-case": {
@@ -1586,124 +1679,132 @@ const Y = "sort-object-types", Ee = j({
1586
1679
  defaultOptions: [
1587
1680
  {
1588
1681
  type: p.alphabetical,
1589
- order: d.asc
1682
+ order: g.asc
1590
1683
  }
1591
1684
  ],
1592
- create: (r) => {
1593
- let l = (s) => {
1685
+ create: (t) => {
1686
+ let n = (s) => {
1594
1687
  if (s.properties.length > 1) {
1595
- let t = C(r.options.at(0), {
1688
+ let l = j(t.options.at(0), {
1596
1689
  "partition-by-new-line": !1,
1597
1690
  "partition-by-comment": !1,
1598
1691
  type: p.alphabetical,
1599
1692
  "styled-components": !0,
1600
1693
  "ignore-case": !1,
1601
- order: d.asc,
1694
+ order: g.asc,
1602
1695
  "custom-groups": {},
1603
1696
  groups: []
1604
- }), u = (i) => i.type === "Identifier" && i.name === "styled", n = (i) => i !== void 0 && i.type === "CallExpression" && (i.callee.type === "MemberExpression" && u(i.callee.object) || i.callee.type === "CallExpression" && u(i.callee.callee));
1605
- if (!t["styled-components"] && (n(s.parent) || s.parent.type === "ArrowFunctionExpression" && n(s.parent.parent)))
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)))
1606
1699
  return;
1607
- let e = r.getSourceCode(), a = (i) => i.reduce(
1608
- (o, c) => {
1609
- var S;
1610
- if (c.type === "SpreadElement" || c.type === "RestElement")
1700
+ let a = (i) => i.reduce(
1701
+ (o, u) => {
1702
+ var N;
1703
+ if (u.type === "SpreadElement" || u.type === "RestElement")
1611
1704
  return o.push([]), o;
1612
- let y = J(c, e), h = (S = o.at(-1)) == null ? void 0 : S.at(-1);
1613
- t["partition-by-comment"] && y && pe(
1614
- t["partition-by-comment"],
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(
1707
+ l["partition-by-comment"],
1615
1708
  y.value
1616
1709
  ) && o.push([]);
1617
- let f, g = "ignore", m = [], { getGroup: w, setCustomGroups: E } = R(t.groups);
1618
- c.key.type === "Identifier" ? { name: f } = c.key : c.key.type === "Literal" ? f = `${c.key.value}` : f = e.text.slice(...c.key.range);
1619
- let b = {
1620
- size: v(c.range),
1621
- node: c,
1622
- name: f
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
1623
1716
  };
1624
- t["partition-by-new-line"] && h && B(e, h, b) && o.push([]), c.value.type === "AssignmentPattern" && ((G) => {
1625
- G.right.type === "Identifier" && m.push(G.right.name);
1626
- let ie = ($) => {
1627
- let U = [];
1628
- switch ($.type) {
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) => {
1720
+ let D = [];
1721
+ switch (R.type) {
1629
1722
  case "ArrowFunctionExpression":
1630
- U.push($.body);
1723
+ D.push(R.body);
1631
1724
  break;
1632
1725
  case "ConditionalExpression":
1633
- U.push($.consequent, $.alternate);
1726
+ D.push(R.consequent, R.alternate);
1634
1727
  break;
1635
1728
  case "LogicalExpression":
1636
1729
  case "BinaryExpression":
1637
- U.push($.left, $.right);
1730
+ D.push(R.left, R.right);
1638
1731
  break;
1639
1732
  case "CallExpression":
1640
- U.push(...$.arguments);
1733
+ D.push(...R.arguments);
1641
1734
  break;
1642
1735
  }
1643
- U.forEach((z) => {
1644
- z.type === "Identifier" && m.push(z.name), (z.type === "BinaryExpression" || z.type === "ConditionalExpression") && ie(z);
1736
+ D.forEach((U) => {
1737
+ U.type === "Identifier" && f.push(U.name), (U.type === "BinaryExpression" || U.type === "ConditionalExpression") && le(U);
1645
1738
  });
1646
1739
  };
1647
- switch (G.right.type) {
1740
+ switch (M.right.type) {
1648
1741
  case "ArrowFunctionExpression":
1649
1742
  case "ConditionalExpression":
1650
1743
  case "LogicalExpression":
1651
1744
  case "BinaryExpression":
1652
1745
  case "CallExpression":
1653
- ie(G.right);
1746
+ le(M.right);
1654
1747
  break;
1655
1748
  }
1656
- })(c.value), E(t["custom-groups"], f);
1657
- let N = {
1658
- ...b,
1659
- group: w(),
1660
- dependencies: m,
1661
- position: g
1749
+ })(u.value), E(l["custom-groups"], c);
1750
+ let C = {
1751
+ ...h,
1752
+ group: b(),
1753
+ dependencies: f,
1754
+ position: d
1662
1755
  };
1663
- return o.at(-1).push(N), o;
1756
+ return o.at(-1).push(C), o;
1664
1757
  },
1665
1758
  [[]]
1666
1759
  );
1667
1760
  for (let i of a(s.properties))
1668
- P(i, (o, c) => {
1669
- let y = x(t.groups, o), h = x(t.groups, c);
1670
- if (y > h || y === h && k(O(o, c, t))) {
1671
- let f = (g) => {
1672
- let m = {};
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 = {};
1673
1766
  for (let E of i) {
1674
- let b = x(t.groups, E);
1675
- b in m ? m[b] = A(
1676
- [...m[b], E],
1677
- t
1678
- ) : m[b] = [E];
1767
+ let h = x(l.groups, E);
1768
+ h in f ? f[h] = w(
1769
+ [...f[h], E],
1770
+ l
1771
+ ) : f[h] = [E];
1679
1772
  }
1680
- let w = [];
1681
- for (let E of Object.keys(m).sort())
1682
- w.push(...A(m[E], t));
1683
- return T(g, i, w, e, {
1684
- partitionComment: t["partition-by-comment"]
1685
- });
1773
+ let b = [];
1774
+ for (let E of Object.keys(f).sort(
1775
+ (h, C) => Number(h) - Number(C)
1776
+ ))
1777
+ b.push(...w(f[E], l));
1778
+ return L(
1779
+ d,
1780
+ i,
1781
+ b,
1782
+ t.sourceCode,
1783
+ {
1784
+ partitionComment: l["partition-by-comment"]
1785
+ }
1786
+ );
1686
1787
  };
1687
- r.report({
1788
+ t.report({
1688
1789
  messageId: "unexpectedObjectsOrder",
1689
1790
  data: {
1690
- left: I(o.name),
1691
- right: I(c.name)
1791
+ left: A(o.name),
1792
+ right: A(u.name)
1692
1793
  },
1693
- node: c.node,
1694
- fix: f
1794
+ node: u.node,
1795
+ fix: c
1695
1796
  });
1696
1797
  }
1697
1798
  });
1698
1799
  }
1699
1800
  };
1700
1801
  return {
1701
- ObjectExpression: l,
1702
- ObjectPattern: l
1802
+ ObjectExpression: n,
1803
+ ObjectPattern: n
1703
1804
  };
1704
1805
  }
1705
- }), ne = "sort-classes", je = j({
1706
- name: ne,
1806
+ }), ae = "sort-classes", Oe = O({
1807
+ name: ae,
1707
1808
  meta: {
1708
1809
  type: "suggestion",
1709
1810
  docs: {
@@ -1728,8 +1829,8 @@ const Y = "sort-object-types", Ee = j({
1728
1829
  default: !1
1729
1830
  },
1730
1831
  order: {
1731
- enum: [d.asc, d.desc],
1732
- default: d.asc,
1832
+ enum: [g.asc, g.desc],
1833
+ default: g.asc,
1733
1834
  type: "string"
1734
1835
  },
1735
1836
  groups: {
@@ -1747,81 +1848,84 @@ const Y = "sort-object-types", Ee = j({
1747
1848
  defaultOptions: [
1748
1849
  {
1749
1850
  type: p.alphabetical,
1750
- order: d.asc
1851
+ order: g.asc
1751
1852
  }
1752
1853
  ],
1753
- create: (r) => ({
1754
- ClassBody: (l) => {
1755
- if (l.body.length > 1) {
1756
- let s = C(r.options.at(0), {
1854
+ create: (t) => ({
1855
+ ClassBody: (n) => {
1856
+ if (n.body.length > 1) {
1857
+ let s = j(t.options.at(0), {
1757
1858
  type: p.alphabetical,
1758
- order: d.asc,
1859
+ order: g.asc,
1759
1860
  "ignore-case": !1,
1760
1861
  groups: ["property", "constructor", "method", "unknown"]
1761
- }), t = r.getSourceCode(), u = l.body.map((n) => {
1762
- var c;
1763
- let e, { getGroup: a, defineGroup: i } = R(s.groups);
1764
- n.type === "StaticBlock" ? e = "static" : n.type === "TSIndexSignature" ? e = t.text.slice(
1765
- n.range.at(0),
1766
- ((c = n.typeAnnotation) == null ? void 0 : c.range.at(0)) ?? n.range.at(1)
1767
- ) : n.key.type === "Identifier" ? { name: e } = n.key : e = t.text.slice(...n.key.range);
1862
+ }), l = n.body.map((r) => {
1863
+ var u;
1864
+ let e, { getGroup: a, defineGroup: i } = G(s.groups);
1865
+ r.type === "StaticBlock" ? e = "static" : r.type === "TSIndexSignature" ? e = t.sourceCode.text.slice(
1866
+ r.range.at(0),
1867
+ ((u = r.typeAnnotation) == null ? void 0 : u.range.at(0)) ?? r.range.at(1)
1868
+ ) : r.key.type === "Identifier" ? { name: e } = r.key : e = t.sourceCode.text.slice(...r.key.range);
1768
1869
  let o = e.startsWith("_") || e.startsWith("#");
1769
- if (n.type === "MethodDefinition") {
1770
- n.kind === "constructor" && i("constructor");
1771
- let y = n.accessibility === "private" || o, h = n.static;
1772
- y && h && i("static-private-method"), y && i("private-method"), h && i("static-method"), n.kind === "get" && i("get-method"), n.kind === "set" && i("set-method"), i("method");
1870
+ if (r.type === "MethodDefinition") {
1871
+ 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");
1773
1874
  } else
1774
- n.type === "TSIndexSignature" ? i("index-signature") : n.type === "PropertyDefinition" && ((n.accessibility === "private" || o) && i("private-property"), n.static && i("static-property"), i("property"));
1875
+ r.type === "TSIndexSignature" ? i("index-signature") : r.type === "PropertyDefinition" && ((r.accessibility === "private" || o) && i("private-property"), r.static && i("static-property"), i("property"));
1775
1876
  return {
1776
- size: v(n.range),
1877
+ size: v(r.range),
1777
1878
  group: a(),
1778
- node: n,
1879
+ node: r,
1779
1880
  name: e
1780
1881
  };
1781
1882
  });
1782
- P(u, (n, e) => {
1783
- let a = x(s.groups, n), i = x(s.groups, e);
1784
- n.name !== e.name && (a > i || a === i && k(O(n, e, s))) && r.report({
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({
1785
1886
  messageId: "unexpectedClassesOrder",
1786
1887
  data: {
1787
- left: I(n.name),
1788
- right: I(e.name)
1888
+ left: A(r.name),
1889
+ right: A(e.name)
1789
1890
  },
1790
1891
  node: e.node,
1791
1892
  fix: (o) => {
1792
- let c = [], y = u.reduce(
1793
- (f, g) => {
1794
- let m = x(s.groups, g);
1795
- return m in f ? f[m] = A(
1796
- [...f[m], g],
1893
+ let u = [], y = l.reduce(
1894
+ (c, d) => {
1895
+ let f = x(s.groups, d);
1896
+ return f in c ? c[f] = w(
1897
+ [...c[f], d],
1797
1898
  s
1798
- ) : f[m] = [g], f;
1899
+ ) : c[f] = [d], c;
1799
1900
  },
1800
1901
  {}
1801
- ), h = Object.keys(y).sort().reduce(
1802
- (f, g) => [
1803
- ...f,
1804
- ...y[g]
1902
+ ), m = Object.keys(y).sort((c, d) => Number(c) - Number(d)).reduce(
1903
+ (c, d) => [
1904
+ ...c,
1905
+ ...y[d]
1805
1906
  ],
1806
1907
  []
1807
1908
  );
1808
- for (let f = 0, g = h.length; f < g; f++)
1809
- c.push(
1909
+ for (let c = 0, d = m.length; c < d; c++)
1910
+ u.push(
1810
1911
  o.replaceTextRange(
1811
- M(u.at(f).node, t),
1812
- t.text.slice(
1813
- ...M(h.at(f).node, t)
1912
+ T(l.at(c).node, t.sourceCode),
1913
+ t.sourceCode.text.slice(
1914
+ ...T(
1915
+ m.at(c).node,
1916
+ t.sourceCode
1917
+ )
1814
1918
  )
1815
1919
  )
1816
1920
  );
1817
- return c;
1921
+ return u;
1818
1922
  }
1819
1923
  });
1820
1924
  });
1821
1925
  }
1822
1926
  }
1823
1927
  })
1824
- }), oe = "sort-enums", ve = j({
1928
+ }), oe = "sort-enums", ve = O({
1825
1929
  name: oe,
1826
1930
  meta: {
1827
1931
  type: "suggestion",
@@ -1847,8 +1951,8 @@ const Y = "sort-object-types", Ee = j({
1847
1951
  default: !1
1848
1952
  },
1849
1953
  order: {
1850
- enum: [d.asc, d.desc],
1851
- default: d.asc,
1954
+ enum: [g.asc, g.desc],
1955
+ default: g.asc,
1852
1956
  type: "string"
1853
1957
  }
1854
1958
  },
@@ -1862,37 +1966,42 @@ const Y = "sort-object-types", Ee = j({
1862
1966
  defaultOptions: [
1863
1967
  {
1864
1968
  type: p.alphabetical,
1865
- order: d.asc
1969
+ order: g.asc
1866
1970
  }
1867
1971
  ],
1868
- create: (r) => ({
1869
- TSEnumDeclaration: (l) => {
1870
- if (l.members.length > 1 && l.members.every(({ initializer: s }) => s)) {
1871
- let s = C(r.options.at(0), {
1972
+ create: (t) => ({
1973
+ TSEnumDeclaration: (n) => {
1974
+ if (n.members.length > 1 && n.members.every(({ initializer: s }) => s)) {
1975
+ let s = j(t.options.at(0), {
1872
1976
  type: p.alphabetical,
1873
- order: d.asc,
1977
+ order: g.asc,
1874
1978
  "ignore-case": !1
1875
- }), t = r.getSourceCode(), u = l.members.map((n) => ({
1876
- name: n.id.type === "Literal" ? `${n.id.value}` : `${t.text.slice(...n.id.range)}`,
1877
- size: v(n.range),
1878
- node: n
1979
+ }), l = n.members.map((r) => ({
1980
+ name: r.id.type === "Literal" ? `${r.id.value}` : `${t.sourceCode.text.slice(...r.id.range)}`,
1981
+ size: v(r.range),
1982
+ node: r
1879
1983
  }));
1880
- P(u, (n, e) => {
1881
- k(O(n, e, s)) && r.report({
1984
+ k(l, (r, e) => {
1985
+ I(S(r, e, s)) && t.report({
1882
1986
  messageId: "unexpectedEnumsOrder",
1883
1987
  data: {
1884
- left: I(n.name),
1885
- right: I(e.name)
1988
+ left: A(r.name),
1989
+ right: A(e.name)
1886
1990
  },
1887
1991
  node: e.node,
1888
- fix: (a) => T(a, u, A(u, s), t)
1992
+ fix: (a) => L(
1993
+ a,
1994
+ l,
1995
+ w(l, s),
1996
+ t.sourceCode
1997
+ )
1889
1998
  });
1890
1999
  });
1891
2000
  }
1892
2001
  }
1893
2002
  })
1894
- }), le = "sort-maps", ke = j({
1895
- name: le,
2003
+ }), ne = "sort-maps", Ie = O({
2004
+ name: ne,
1896
2005
  meta: {
1897
2006
  type: "suggestion",
1898
2007
  docs: {
@@ -1913,8 +2022,8 @@ const Y = "sort-object-types", Ee = j({
1913
2022
  type: "string"
1914
2023
  },
1915
2024
  order: {
1916
- enum: [d.asc, d.desc],
1917
- default: d.asc,
2025
+ enum: [g.asc, g.desc],
2026
+ default: g.asc,
1918
2027
  type: "string"
1919
2028
  },
1920
2029
  "ignore-case": {
@@ -1932,45 +2041,50 @@ const Y = "sort-object-types", Ee = j({
1932
2041
  defaultOptions: [
1933
2042
  {
1934
2043
  type: p.alphabetical,
1935
- order: d.asc
2044
+ order: g.asc
1936
2045
  }
1937
2046
  ],
1938
- create: (r) => ({
1939
- NewExpression: (l) => {
1940
- if (l.callee.type === "Identifier" && l.callee.name === "Map" && l.arguments.length && l.arguments[0].type === "ArrayExpression") {
1941
- let [{ elements: s }] = l.arguments;
2047
+ create: (t) => ({
2048
+ NewExpression: (n) => {
2049
+ if (n.callee.type === "Identifier" && n.callee.name === "Map" && n.arguments.length && n.arguments[0].type === "ArrayExpression") {
2050
+ let [{ elements: s }] = n.arguments;
1942
2051
  if (s.length > 1) {
1943
- let t = C(r.options.at(0), {
2052
+ let l = j(t.options.at(0), {
1944
2053
  type: p.alphabetical,
1945
2054
  "ignore-case": !1,
1946
- order: d.asc
1947
- }), u = r.getSourceCode(), n = s.reduce(
2055
+ order: g.asc
2056
+ }), r = s.reduce(
1948
2057
  (e, a) => (a === null || a.type === "SpreadElement" ? e.push([]) : e.at(-1).push(a), e),
1949
2058
  [[]]
1950
2059
  );
1951
- for (let e of n) {
2060
+ for (let e of r) {
1952
2061
  let a = e.map((i) => {
1953
2062
  let o;
1954
2063
  if (i.type === "ArrayExpression") {
1955
- let [c] = i.elements;
1956
- c ? c.type === "Literal" ? o = c.raw : o = u.text.slice(...c.range) : o = `${c}`;
2064
+ let [u] = i.elements;
2065
+ u ? u.type === "Literal" ? o = u.raw : o = t.sourceCode.text.slice(...u.range) : o = `${u}`;
1957
2066
  } else
1958
- o = u.text.slice(...i.range);
2067
+ o = t.sourceCode.text.slice(...i.range);
1959
2068
  return {
1960
2069
  size: v(i.range),
1961
2070
  node: i,
1962
2071
  name: o
1963
2072
  };
1964
2073
  });
1965
- P(a, (i, o) => {
1966
- k(O(i, o, t)) && r.report({
2074
+ k(a, (i, o) => {
2075
+ I(S(i, o, l)) && t.report({
1967
2076
  messageId: "unexpectedMapElementsOrder",
1968
2077
  data: {
1969
- left: I(i.name),
1970
- right: I(o.name)
2078
+ left: A(i.name),
2079
+ right: A(o.name)
1971
2080
  },
1972
2081
  node: o.node,
1973
- fix: (c) => T(c, a, A(a, t), u)
2082
+ fix: (u) => L(
2083
+ u,
2084
+ a,
2085
+ w(a, l),
2086
+ t.sourceCode
2087
+ )
1974
2088
  });
1975
2089
  });
1976
2090
  }
@@ -1978,10 +2092,10 @@ const Y = "sort-object-types", Ee = j({
1978
2092
  }
1979
2093
  }
1980
2094
  })
1981
- }), Ce = "eslint-plugin-perfectionist";
1982
- let V = (r) => {
1983
- let l = {
1984
- [se]: [
2095
+ }), je = "eslint-plugin-perfectionist";
2096
+ let W = (t) => {
2097
+ let n = {
2098
+ [re]: [
1985
2099
  "error",
1986
2100
  {
1987
2101
  groups: [
@@ -2002,7 +2116,7 @@ let V = (r) => {
2002
2116
  "internal-pattern": ["~/**"]
2003
2117
  }
2004
2118
  ],
2005
- [ne]: [
2119
+ [ae]: [
2006
2120
  "error",
2007
2121
  {
2008
2122
  groups: [
@@ -2019,78 +2133,78 @@ let V = (r) => {
2019
2133
  ]
2020
2134
  }
2021
2135
  ],
2022
- [ae]: [
2136
+ [se]: [
2023
2137
  "error",
2024
2138
  {
2025
2139
  "partition-by-comment": !1
2026
2140
  }
2027
2141
  ],
2028
- [K]: [
2142
+ [q]: [
2029
2143
  "error",
2030
2144
  {
2031
2145
  "spread-last": !0
2032
2146
  }
2033
2147
  ],
2148
+ [J]: ["error"],
2034
2149
  [X]: ["error"],
2035
- [q]: ["error"],
2036
- [F]: ["error"],
2150
+ [K]: ["error"],
2037
2151
  [H]: ["error"],
2038
2152
  [Q]: ["error"],
2039
2153
  [Y]: ["error"],
2040
2154
  [Z]: ["error"],
2155
+ [F]: ["error"],
2041
2156
  [ee]: ["error"],
2042
2157
  [te]: ["error"],
2043
- [re]: ["error"],
2044
2158
  [oe]: ["error"],
2045
- [le]: ["error"]
2159
+ [ne]: ["error"]
2046
2160
  };
2047
2161
  return {
2048
2162
  rules: Object.fromEntries(
2049
- Object.entries(l).map(([s, [t, u = {}]]) => [
2163
+ Object.entries(n).map(([s, [l, r = {}]]) => [
2050
2164
  `perfectionist/${s}`,
2051
- [t, Object.assign(u, r)]
2165
+ [l, Object.assign(r, t)]
2052
2166
  ])
2053
2167
  ),
2054
2168
  plugins: ["perfectionist"]
2055
2169
  };
2056
2170
  };
2057
- const Re = {
2171
+ const Ge = {
2058
2172
  rules: {
2059
- [K]: me,
2060
2173
  [q]: ye,
2061
- [ne]: je,
2062
- [oe]: ve,
2063
- [re]: Ne,
2064
- [se]: Oe,
2065
- [ee]: we,
2066
- [te]: Ae,
2067
- [le]: ke,
2068
- [H]: be,
2069
- [Q]: xe,
2070
- [Y]: Ee,
2071
- [ae]: Ie,
2072
2174
  [X]: ge,
2073
- [Z]: Se,
2074
- [F]: he
2175
+ [ae]: Oe,
2176
+ [oe]: ve,
2177
+ [te]: we,
2178
+ [re]: Se,
2179
+ [F]: Ce,
2180
+ [ee]: Ne,
2181
+ [ne]: Ie,
2182
+ [H]: he,
2183
+ [Q]: be,
2184
+ [Y]: xe,
2185
+ [se]: Ae,
2186
+ [J]: fe,
2187
+ [Z]: Ee,
2188
+ [K]: me
2075
2189
  },
2076
2190
  configs: {
2077
- "recommended-alphabetical": V({
2191
+ "recommended-alphabetical": W({
2078
2192
  type: p.alphabetical,
2079
- order: d.asc,
2193
+ order: g.asc,
2080
2194
  "ignore-case": !1
2081
2195
  }),
2082
- "recommended-natural": V({
2196
+ "recommended-natural": W({
2083
2197
  type: p.natural,
2084
- order: d.asc,
2198
+ order: g.asc,
2085
2199
  "ignore-case": !1
2086
2200
  }),
2087
- "recommended-line-length": V({
2201
+ "recommended-line-length": W({
2088
2202
  type: p["line-length"],
2089
- order: d.desc
2203
+ order: g.desc
2090
2204
  })
2091
2205
  },
2092
- name: Ce
2206
+ name: je
2093
2207
  };
2094
2208
  export {
2095
- Re as default
2209
+ Ge as default
2096
2210
  };