eslint-plugin-perfectionist 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,119 +1,131 @@
1
1
  import U from "path";
2
2
  import { ESLintUtils as ne, ASTUtils as D } from "@typescript-eslint/utils";
3
- import { minimatch as $ } from "minimatch";
3
+ import { minimatch as M } from "minimatch";
4
4
  import le from "natural-compare-lite";
5
5
  import { builtinModules as ie } from "module";
6
- let v = ne.RuleCreator(
7
- (s) => `https://eslint-plugin-perfectionist.azat.io/rules/${s}`
8
- ), x = (s, l) => {
9
- for (let n = 0, a = s.length; n < a; n++) {
10
- let u = s[n];
6
+ let O = ne.RuleCreator(
7
+ (a) => `https://eslint-plugin-perfectionist.azat.io/rules/${a}`
8
+ ), x = (a, l) => {
9
+ for (let s = 0, o = a.length; s < o; s++) {
10
+ let u = a[s];
11
11
  if (l.group === u || Array.isArray(u) && typeof l.group == "string" && u.includes(l.group))
12
- return n;
12
+ return s;
13
13
  }
14
- return s.length;
15
- }, w = (s) => {
16
- let [l, n] = s;
17
- return n - l;
18
- }, j = (s) => s > 0;
19
- var i = /* @__PURE__ */ ((s) => (s.alphabetical = "alphabetical", s["line-length"] = "line-length", s.natural = "natural", s))(i || {}), f = /* @__PURE__ */ ((s) => (s.desc = "desc", s.asc = "asc", s))(f || {});
20
- let G = (s) => {
21
- let l, n = (u) => {
22
- !l && s.flat().includes(u) && (l = u);
14
+ return a.length;
15
+ }, w = (a) => {
16
+ let [l, s] = a;
17
+ return s - l;
18
+ }, v = (a) => a > 0;
19
+ var i = /* @__PURE__ */ ((a) => (a.alphabetical = "alphabetical", a["line-length"] = "line-length", a.natural = "natural", a))(i || {}), f = /* @__PURE__ */ ((a) => (a.desc = "desc", a.asc = "asc", a))(f || {});
20
+ let R = (a) => {
21
+ let l, s = (u) => {
22
+ !l && a.flat().includes(u) && (l = u);
23
23
  };
24
24
  return {
25
25
  getGroup: () => l ?? "unknown",
26
- setCustomGroups: (u, t) => {
26
+ setCustomGroups: (u, r) => {
27
27
  if (u)
28
- for (let [e, o] of Object.entries(u))
29
- Array.isArray(o) && o.some((r) => $(t, r)) && n(e), typeof o == "string" && $(t, o) && n(e);
28
+ for (let [e, t] of Object.entries(u))
29
+ Array.isArray(t) && t.some(
30
+ (n) => M(r, n, {
31
+ nocomment: !0
32
+ })
33
+ ) && s(e), typeof t == "string" && M(r, t, {
34
+ nocomment: !0
35
+ }) && s(e);
30
36
  },
31
- defineGroup: n
37
+ defineGroup: s
32
38
  };
33
- }, I = (s, l, n) => {
34
- var e, o;
35
- if ((e = l.dependencies) != null && e.includes(s.name))
39
+ }, A = (a, l, s) => {
40
+ var e, t;
41
+ if ((e = l.dependencies) != null && e.includes(a.name))
36
42
  return -1;
37
- if ((o = s.dependencies) != null && o.includes(l.name))
43
+ if ((t = a.dependencies) != null && t.includes(l.name))
38
44
  return 1;
39
- let a = n.order === "asc" ? 1 : -1, u, t = (r) => n["ignore-case"] ? r.toLowerCase() : r;
40
- return n.type === i.alphabetical ? u = (r, c) => t(r.name).localeCompare(t(c.name)) : n.type === i.natural ? u = (r, c) => le(t(r.name), t(c.name)) : u = (r, c) => r.size - c.size, a * u(s, l);
41
- }, N = (s, l) => [...s].sort((n, a) => I(n, a, l)), pe = (s, l) => {
42
- let n = l.getTokenAfter(s, {
43
- filter: ({ value: a, type: u }) => !(u === "Punctuator" && [",", ";"].includes(a)),
45
+ let o = s.order === "asc" ? 1 : -1, u, r = (n) => s["ignore-case"] ? n.toLowerCase() : n;
46
+ return s.type === i.alphabetical ? u = (n, c) => r(n.name).localeCompare(r(c.name)) : s.type === i.natural ? u = (n, c) => le(r(n.name), r(c.name)) : u = (n, c) => n.size - c.size, o * u(a, l);
47
+ }, S = (a, l) => [...a].sort((s, o) => A(s, o, l)), pe = (a, l) => {
48
+ let s = l.getTokenAfter(a, {
49
+ filter: ({ value: o, type: u }) => !(u === "Punctuator" && [",", ";"].includes(o)),
44
50
  includeComments: !0
45
51
  });
46
- return ((n == null ? void 0 : n.type) === "Block" || (n == null ? void 0 : n.type) === "Line") && s.loc.end.line === n.loc.end.line ? n : null;
47
- }, oe = (s, l) => Array.isArray(s) && s.some((n) => $(l.trim(), n)) || typeof s == "string" && $(l.trim(), s) || s === !0, _ = (s, l) => {
48
- let [n, a] = l.getTokensBefore(s, {
49
- filter: ({ value: u, type: t }) => !(t === "Punctuator" && [",", ";"].includes(u)),
52
+ return ((s == null ? void 0 : s.type) === "Block" || (s == null ? void 0 : s.type) === "Line") && a.loc.end.line === s.loc.end.line ? s : null;
53
+ }, oe = (a, l) => Array.isArray(a) && a.some(
54
+ (s) => M(l.trim(), s, {
55
+ nocomment: !0
56
+ })
57
+ ) || typeof a == "string" && M(l.trim(), a, {
58
+ nocomment: !0
59
+ }) || a === !0, _ = (a, l) => {
60
+ let [s, o] = l.getTokensBefore(a, {
61
+ filter: ({ value: u, type: r }) => !(r === "Punctuator" && [",", ";"].includes(u)),
50
62
  includeComments: !0,
51
63
  count: 2
52
64
  });
53
- return ((a == null ? void 0 : a.type) === "Block" || (a == null ? void 0 : a.type) === "Line") && s.loc.start.line - a.loc.end.line <= 1 && (n == null ? void 0 : n.loc.end.line) !== a.loc.start.line ? a : null;
54
- }, L = (s, l, n) => {
55
- var o;
56
- let a = s.range.at(0), u = s.range.at(1), t = l.text.slice(a, u);
57
- if (D.isParenthesized(s, l)) {
58
- let r = l.getTokenBefore(
59
- s,
65
+ return ((o == null ? void 0 : o.type) === "Block" || (o == null ? void 0 : o.type) === "Line") && a.loc.start.line - o.loc.end.line <= 1 && (s == null ? void 0 : s.loc.end.line) !== o.loc.start.line ? o : null;
66
+ }, T = (a, l, s) => {
67
+ var t;
68
+ let o = a.range.at(0), u = a.range.at(1), r = l.text.slice(o, u);
69
+ if (D.isParenthesized(a, l)) {
70
+ let n = l.getTokenBefore(
71
+ a,
60
72
  D.isOpeningParenToken
61
73
  ), c = l.getTokenAfter(
62
- s,
74
+ a,
63
75
  D.isClosingParenToken
64
76
  );
65
- a = r.range.at(0), u = c.range.at(1);
77
+ o = n.range.at(0), u = c.range.at(1);
66
78
  }
67
- let e = _(s, l);
68
- if (t.endsWith(";") || t.endsWith(",")) {
69
- let r = l.getTokensAfter(s, {
79
+ let e = _(a, l);
80
+ if (r.endsWith(";") || r.endsWith(",")) {
81
+ let n = l.getTokensAfter(a, {
70
82
  includeComments: !0,
71
83
  count: 2
72
84
  });
73
- s.loc.start.line === ((o = r.at(1)) == null ? void 0 : o.loc.start.line) && (u -= 1);
85
+ a.loc.start.line === ((t = n.at(1)) == null ? void 0 : t.loc.start.line) && (u -= 1);
74
86
  }
75
87
  return e && !oe(
76
- (n == null ? void 0 : n.partitionComment) ?? !1,
88
+ (s == null ? void 0 : s.partitionComment) ?? !1,
77
89
  e.value
78
- ) && (a = e.range.at(0)), [a, u];
79
- }, P = (s, l, n, a, u) => {
80
- var o, r;
81
- let t = [], e = ((o = l.at(0)) == null ? void 0 : o.node.loc.start.line) === ((r = l.at(-1)) == null ? void 0 : r.node.loc.end.line);
90
+ ) && (o = e.range.at(0)), [o, u];
91
+ }, C = (a, l, s, o, u) => {
92
+ var t, n;
93
+ let r = [], e = ((t = l.at(0)) == null ? void 0 : t.node.loc.start.line) === ((n = l.at(-1)) == null ? void 0 : n.node.loc.end.line);
82
94
  for (let c = 0, d = l.length; c < d; c++) {
83
- let { node: y } = l.at(c);
84
- t.push(
85
- s.replaceTextRange(
86
- L(y, a, u),
87
- a.text.slice(
88
- ...L(n.at(c).node, a, u)
95
+ let { node: m } = l.at(c);
96
+ r.push(
97
+ a.replaceTextRange(
98
+ T(m, o, u),
99
+ o.text.slice(
100
+ ...T(s.at(c).node, o, u)
89
101
  )
90
102
  )
91
103
  );
92
- let m = pe(n.at(c).node, a);
93
- if (m && !e) {
94
- let p = [
95
- a.getTokenBefore(m).range.at(1),
96
- m.range.at(1)
104
+ let g = pe(s.at(c).node, o);
105
+ if (g && !e) {
106
+ let y = [
107
+ o.getTokenBefore(g).range.at(1),
108
+ g.range.at(1)
97
109
  ];
98
- t.push(s.replaceTextRange(p, ""));
99
- let h = a.getTokenAfter(y);
100
- t.push(
101
- s.insertTextAfter(
102
- (h == null ? void 0 : h.loc.end.line) === y.loc.end.line ? h : y,
103
- a.text.slice(...p)
110
+ r.push(a.replaceTextRange(y, ""));
111
+ let h = o.getTokenAfter(m);
112
+ r.push(
113
+ a.insertTextAfter(
114
+ (h == null ? void 0 : h.loc.end.line) === m.loc.end.line ? h : m,
115
+ o.text.slice(...y)
104
116
  )
105
117
  );
106
118
  }
107
119
  }
108
- return t;
109
- }, k = (s = {}, l) => Object.assign(l, s), C = (s, l) => {
110
- if (s.length > 1)
111
- for (let n = 1; n < s.length; n++) {
112
- let a = s.at(n - 1), u = s.at(n);
113
- a && u && l(a, u, n - 1);
120
+ return r;
121
+ }, j = (a = {}, l) => Object.assign(l, a), k = (a, l) => {
122
+ if (a.length > 1)
123
+ for (let s = 1; s < a.length; s++) {
124
+ let o = a.at(s - 1), u = a.at(s);
125
+ o && u && l(o, u, s - 1);
114
126
  }
115
127
  };
116
- const V = "sort-svelte-attributes", ue = v({
128
+ const V = "sort-svelte-attributes", ue = O({
117
129
  name: V,
118
130
  meta: {
119
131
  type: "suggestion",
@@ -163,61 +175,61 @@ const V = "sort-svelte-attributes", ue = v({
163
175
  order: f.asc
164
176
  }
165
177
  ],
166
- create: (s) => U.extname(s.getFilename()) !== ".svelte" ? {} : {
178
+ create: (a) => U.extname(a.getFilename()) !== ".svelte" ? {} : {
167
179
  SvelteStartTag: (l) => {
168
180
  if (l.attributes.length > 1) {
169
- let n = k(s.options.at(0), {
181
+ let s = j(a.options.at(0), {
170
182
  type: i.alphabetical,
171
183
  order: f.asc,
172
184
  "ignore-case": !1,
173
185
  "custom-groups": {},
174
186
  groups: []
175
- }), a = s.getSourceCode(), u = l.attributes.reduce(
176
- (t, e) => {
187
+ }), o = a.getSourceCode(), u = l.attributes.reduce(
188
+ (r, e) => {
177
189
  if (e.type === "SvelteSpreadAttribute")
178
- return t.push([]), t;
179
- let o, { getGroup: r, defineGroup: c, setCustomGroups: d } = G(
180
- n.groups
190
+ return r.push([]), r;
191
+ let t, { getGroup: n, defineGroup: c, setCustomGroups: d } = R(
192
+ s.groups
181
193
  );
182
- return e.key.type === "SvelteSpecialDirectiveKey" ? o = a.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: o } = e.key : o = a.text.slice(...e.key.range), d(n["custom-groups"], o), e.type === "SvelteShorthandAttribute" && (c("svelte-shorthand"), c("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && c("shorthand"), e.loc.start.line !== e.loc.end.line && c("multiline"), t.at(-1).push({
194
+ return e.key.type === "SvelteSpecialDirectiveKey" ? t = o.text.slice(...e.key.range) : typeof e.key.name == "string" ? { name: t } = e.key : t = o.text.slice(...e.key.range), d(s["custom-groups"], t), e.type === "SvelteShorthandAttribute" && (c("svelte-shorthand"), c("shorthand")), (!("value" in e) || Array.isArray(e.value) && !e.value.at(0)) && c("shorthand"), e.loc.start.line !== e.loc.end.line && c("multiline"), r.at(-1).push({
183
195
  size: w(e.range),
184
196
  node: e,
185
- group: r(),
186
- name: o
187
- }), t;
197
+ group: n(),
198
+ name: t
199
+ }), r;
188
200
  },
189
201
  [[]]
190
202
  );
191
- for (let t of u)
192
- C(t, (e, o) => {
193
- let r = x(n.groups, e), c = x(n.groups, o);
194
- (r > c || r === c && j(I(e, o, n))) && s.report({
203
+ for (let r of u)
204
+ k(r, (e, t) => {
205
+ let n = x(s.groups, e), c = x(s.groups, t);
206
+ (n > c || n === c && v(A(e, t, s))) && a.report({
195
207
  messageId: "unexpectedSvelteAttributesOrder",
196
208
  data: {
197
209
  left: e.name,
198
- right: o.name
210
+ right: t.name
199
211
  },
200
- node: o.node,
212
+ node: t.node,
201
213
  fix: (d) => {
202
- let y = {};
203
- for (let g of t) {
204
- let p = x(n.groups, g);
205
- p in y ? y[p] = N(
206
- [...y[p], g],
207
- n
208
- ) : y[p] = [g];
214
+ let m = {};
215
+ for (let p of r) {
216
+ let y = x(s.groups, p);
217
+ y in m ? m[y] = S(
218
+ [...m[y], p],
219
+ s
220
+ ) : m[y] = [p];
209
221
  }
210
- let m = [];
211
- for (let g of Object.keys(y).sort())
212
- m.push(...N(y[g], n));
213
- return P(d, t, m, a);
222
+ let g = [];
223
+ for (let p of Object.keys(m).sort())
224
+ g.push(...S(m[p], s));
225
+ return C(d, r, g, o);
214
226
  }
215
227
  });
216
228
  });
217
229
  }
218
230
  }
219
231
  }
220
- }), W = "sort-astro-attributes", ce = v({
232
+ }), W = "sort-astro-attributes", ce = O({
221
233
  name: W,
222
234
  meta: {
223
235
  type: "suggestion",
@@ -268,55 +280,55 @@ const V = "sort-svelte-attributes", ue = v({
268
280
  }
269
281
  ],
270
282
  // @ts-ignore
271
- create: (s) => U.extname(s.getFilename()) !== ".astro" ? {} : {
283
+ create: (a) => U.extname(a.getFilename()) !== ".astro" ? {} : {
272
284
  JSXElement: (l) => {
273
- let { attributes: n } = l.openingElement;
274
- if (n.length > 1) {
275
- let a = k(s.options.at(0), {
285
+ let { attributes: s } = l.openingElement;
286
+ if (s.length > 1) {
287
+ let o = j(a.options.at(0), {
276
288
  type: i.alphabetical,
277
289
  order: f.asc,
278
290
  "ignore-case": !1,
279
291
  "custom-groups": {},
280
292
  groups: []
281
- }), u = s.getSourceCode(), t = n.reduce(
282
- (e, o) => {
283
- if (o.type === "JSXSpreadAttribute")
293
+ }), u = a.getSourceCode(), r = s.reduce(
294
+ (e, t) => {
295
+ if (t.type === "JSXSpreadAttribute")
284
296
  return e.push([]), e;
285
- let r = typeof o.name.name == "string" ? o.name.name : u.text.slice(...o.name.range), { getGroup: c, defineGroup: d, setCustomGroups: y } = G(
286
- a.groups
297
+ let n = typeof t.name.name == "string" ? t.name.name : u.text.slice(...t.name.range), { getGroup: c, defineGroup: d, setCustomGroups: m } = R(
298
+ o.groups
287
299
  );
288
- return y(a["custom-groups"], r), o.type === "AstroShorthandAttribute" && (d("astro-shorthand"), d("shorthand")), o.value === null && d("shorthand"), o.loc.start.line !== o.loc.end.line && d("multiline"), e.at(-1).push({
289
- size: w(o.range),
290
- node: o,
300
+ return m(o["custom-groups"], n), t.type === "AstroShorthandAttribute" && (d("astro-shorthand"), d("shorthand")), t.value === null && d("shorthand"), t.loc.start.line !== t.loc.end.line && d("multiline"), e.at(-1).push({
301
+ size: w(t.range),
302
+ node: t,
291
303
  group: c(),
292
- name: r
304
+ name: n
293
305
  }), e;
294
306
  },
295
307
  [[]]
296
308
  );
297
- for (let e of t)
298
- C(e, (o, r) => {
299
- let c = x(a.groups, o), d = x(a.groups, r);
300
- (c > d || c === d && j(I(o, r, a))) && s.report({
309
+ for (let e of r)
310
+ k(e, (t, n) => {
311
+ let c = x(o.groups, t), d = x(o.groups, n);
312
+ (c > d || c === d && v(A(t, n, o))) && a.report({
301
313
  messageId: "unexpectedAstroAttributesOrder",
302
314
  data: {
303
- left: o.name,
304
- right: r.name
315
+ left: t.name,
316
+ right: n.name
305
317
  },
306
- node: r.node,
307
- fix: (y) => {
308
- let m = {};
309
- for (let p of e) {
310
- let h = x(a.groups, p);
311
- h in m ? m[h] = N(
312
- [...m[h], p],
313
- a
314
- ) : m[h] = [p];
318
+ node: n.node,
319
+ fix: (m) => {
320
+ let g = {};
321
+ for (let y of e) {
322
+ let h = x(o.groups, y);
323
+ h in g ? g[h] = S(
324
+ [...g[h], y],
325
+ o
326
+ ) : g[h] = [y];
315
327
  }
316
- let g = [];
317
- for (let p of Object.keys(m).sort())
318
- g.push(...N(m[p], a));
319
- return P(y, e, g, u);
328
+ let p = [];
329
+ for (let y of Object.keys(g).sort())
330
+ p.push(...S(g[y], o));
331
+ return C(m, e, p, u);
320
332
  }
321
333
  });
322
334
  });
@@ -324,8 +336,8 @@ const V = "sort-svelte-attributes", ue = v({
324
336
  }
325
337
  }
326
338
  });
327
- let O = (s) => s.replaceAll(/\s\s+/g, " ").trim();
328
- const J = "sort-array-includes", de = v({
339
+ let I = (a) => a.replaceAll(/\s\s+/g, " ").trim();
340
+ const J = "sort-array-includes", de = O({
329
341
  name: J,
330
342
  meta: {
331
343
  type: "suggestion",
@@ -373,40 +385,40 @@ const J = "sort-array-includes", de = v({
373
385
  order: f.asc
374
386
  }
375
387
  ],
376
- create: (s) => ({
388
+ create: (a) => ({
377
389
  MemberExpression: (l) => {
378
390
  if ((l.object.type === "ArrayExpression" || l.object.type === "NewExpression") && l.property.type === "Identifier" && l.property.name === "includes") {
379
- let n = l.object.type === "ArrayExpression" ? l.object.elements : l.object.arguments;
380
- if (n.length > 1) {
381
- let a = k(s.options.at(0), {
391
+ let s = l.object.type === "ArrayExpression" ? l.object.elements : l.object.arguments;
392
+ if (s.length > 1) {
393
+ let o = j(a.options.at(0), {
382
394
  type: i.alphabetical,
383
395
  order: f.asc,
384
396
  "ignore-case": !1,
385
397
  "spread-last": !1
386
- }), u = s.getSourceCode(), t = n.reduce(
387
- (e, o) => (o !== null && e.at(0).push({
388
- name: o.type === "Literal" ? `${o.value}` : u.text.slice(...o.range),
389
- size: w(o.range),
390
- type: o.type,
391
- node: o
398
+ }), u = a.getSourceCode(), r = s.reduce(
399
+ (e, t) => (t !== null && e.at(0).push({
400
+ name: t.type === "Literal" ? `${t.value}` : u.text.slice(...t.range),
401
+ size: w(t.range),
402
+ type: t.type,
403
+ node: t
392
404
  }), e),
393
405
  [[], []]
394
406
  ).flat();
395
- C(t, (e, o) => {
396
- let r;
397
- a["spread-last"] && e.node.type === "Literal" && o.node.type === "SpreadElement" ? r = !1 : a["spread-last"] && e.node.type === "SpreadElement" && o.node.type === "Literal" ? r = !0 : r = j(I(e, o, a)), r && s.report({
407
+ k(r, (e, t) => {
408
+ let n;
409
+ o["spread-last"] && e.node.type === "Literal" && t.node.type === "SpreadElement" ? n = !1 : o["spread-last"] && e.node.type === "SpreadElement" && t.node.type === "Literal" ? n = !0 : n = v(A(e, t, o)), n && a.report({
398
410
  messageId: "unexpectedArrayIncludesOrder",
399
411
  data: {
400
- left: O(e.name),
401
- right: O(o.name)
412
+ left: I(e.name),
413
+ right: I(t.name)
402
414
  },
403
- node: o.node,
415
+ node: t.node,
404
416
  fix: (c) => {
405
- let d = N(t, a);
406
- if (a["spread-last"])
407
- for (let y = 0, m = d.length; y < m; y++)
408
- d.at(y).node.type === "SpreadElement" && d.push(d.splice(y, 1).at(0));
409
- return P(c, t, d, u);
417
+ let d = S(r, o);
418
+ if (o["spread-last"])
419
+ for (let m = 0, g = d.length; m < g; m++)
420
+ d.at(m).node.type === "SpreadElement" && d.push(d.splice(m, 1).at(0));
421
+ return C(c, r, d, u);
410
422
  }
411
423
  });
412
424
  });
@@ -414,7 +426,7 @@ const J = "sort-array-includes", de = v({
414
426
  }
415
427
  }
416
428
  })
417
- }), X = "sort-vue-attributes", fe = v({
429
+ }), X = "sort-vue-attributes", fe = O({
418
430
  name: X,
419
431
  meta: {
420
432
  type: "suggestion",
@@ -465,60 +477,60 @@ const J = "sort-array-includes", de = v({
465
477
  order: f.asc
466
478
  }
467
479
  ],
468
- create: (s) => {
469
- if (U.extname(s.getFilename()) !== ".vue")
480
+ create: (a) => {
481
+ if (U.extname(a.getFilename()) !== ".vue")
470
482
  return {};
471
- if (!("defineTemplateBodyVisitor" in s.parserServices))
483
+ if (!("defineTemplateBodyVisitor" in a.parserServices))
472
484
  return {};
473
- let { defineTemplateBodyVisitor: l } = s.parserServices;
485
+ let { defineTemplateBodyVisitor: l } = a.parserServices;
474
486
  return l({
475
- VStartTag: (n) => {
476
- if (n.attributes.length > 1) {
477
- let a = k(s.options.at(0), {
487
+ VStartTag: (s) => {
488
+ if (s.attributes.length > 1) {
489
+ let o = j(a.options.at(0), {
478
490
  type: i.alphabetical,
479
491
  order: f.asc,
480
492
  "ignore-case": !1,
481
493
  "custom-groups": {},
482
494
  groups: []
483
- }), u = s.getSourceCode(), t = n.attributes.reduce(
484
- (e, o) => {
485
- if (o.key.type === "VDirectiveKey" && o.key.name.rawName === "bind")
495
+ }), u = a.getSourceCode(), r = s.attributes.reduce(
496
+ (e, t) => {
497
+ if (t.key.type === "VDirectiveKey" && t.key.name.rawName === "bind")
486
498
  return e.push([]), e;
487
- let r, { getGroup: c, defineGroup: d, setCustomGroups: y } = G(
488
- a.groups
499
+ let n, { getGroup: c, defineGroup: d, setCustomGroups: m } = R(
500
+ o.groups
489
501
  );
490
- return typeof o.key.name == "string" && o.key.type !== "VDirectiveKey" ? r = o.key.rawName : r = u.text.slice(...o.key.range), y(a["custom-groups"], r), o.value === null && d("shorthand"), o.loc.start.line !== o.loc.end.line && d("multiline"), e.at(-1).push({
491
- size: w(o.range),
492
- node: o,
502
+ return typeof t.key.name == "string" && t.key.type !== "VDirectiveKey" ? n = t.key.rawName : n = u.text.slice(...t.key.range), m(o["custom-groups"], n), t.value === null && d("shorthand"), t.loc.start.line !== t.loc.end.line && d("multiline"), e.at(-1).push({
503
+ size: w(t.range),
504
+ node: t,
493
505
  group: c(),
494
- name: r
506
+ name: n
495
507
  }), e;
496
508
  },
497
509
  [[]]
498
510
  );
499
- for (let e of t)
500
- C(e, (o, r) => {
501
- let c = x(a.groups, o), d = x(a.groups, r);
502
- (c > d || c === d && j(I(o, r, a))) && s.report({
511
+ for (let e of r)
512
+ k(e, (t, n) => {
513
+ let c = x(o.groups, t), d = x(o.groups, n);
514
+ (c > d || c === d && v(A(t, n, o))) && a.report({
503
515
  messageId: "unexpectedVueAttributesOrder",
504
516
  data: {
505
- left: o.name,
506
- right: r.name
517
+ left: t.name,
518
+ right: n.name
507
519
  },
508
- node: r.node,
509
- fix: (y) => {
510
- let m = {};
511
- for (let p of e) {
512
- let h = x(a.groups, p);
513
- h in m ? m[h] = N(
514
- [...m[h], p],
515
- a
516
- ) : m[h] = [p];
520
+ node: n.node,
521
+ fix: (m) => {
522
+ let g = {};
523
+ for (let y of e) {
524
+ let h = x(o.groups, y);
525
+ h in g ? g[h] = S(
526
+ [...g[h], y],
527
+ o
528
+ ) : g[h] = [y];
517
529
  }
518
- let g = [];
519
- for (let p of Object.keys(m).sort())
520
- g.push(...N(m[p], a));
521
- return P(y, e, g, u);
530
+ let p = [];
531
+ for (let y of Object.keys(g).sort())
532
+ p.push(...S(g[y], o));
533
+ return C(m, e, p, u);
522
534
  }
523
535
  });
524
536
  });
@@ -526,7 +538,7 @@ const J = "sort-array-includes", de = v({
526
538
  }
527
539
  });
528
540
  }
529
- }), K = "sort-named-exports", ge = v({
541
+ }), K = "sort-named-exports", ge = O({
530
542
  name: K,
531
543
  meta: {
532
544
  type: "suggestion",
@@ -570,33 +582,33 @@ const J = "sort-array-includes", de = v({
570
582
  order: f.asc
571
583
  }
572
584
  ],
573
- create: (s) => ({
585
+ create: (a) => ({
574
586
  ExportNamedDeclaration: (l) => {
575
587
  if (l.specifiers.length > 1) {
576
- let n = k(s.options.at(0), {
588
+ let s = j(a.options.at(0), {
577
589
  type: i.alphabetical,
578
590
  "ignore-case": !1,
579
591
  order: f.asc
580
- }), a = s.getSourceCode(), u = l.specifiers.map((t) => ({
581
- size: w(t.range),
582
- name: t.local.name,
583
- node: t
592
+ }), o = a.getSourceCode(), u = l.specifiers.map((r) => ({
593
+ size: w(r.range),
594
+ name: r.local.name,
595
+ node: r
584
596
  }));
585
- C(u, (t, e) => {
586
- j(I(t, e, n)) && s.report({
597
+ k(u, (r, e) => {
598
+ v(A(r, e, s)) && a.report({
587
599
  messageId: "unexpectedNamedExportsOrder",
588
600
  data: {
589
- left: t.name,
601
+ left: r.name,
590
602
  right: e.name
591
603
  },
592
604
  node: e.node,
593
- fix: (o) => P(o, u, N(u, n), a)
605
+ fix: (t) => C(t, u, S(u, s), o)
594
606
  });
595
607
  });
596
608
  }
597
609
  }
598
610
  })
599
- }), q = "sort-named-imports", ye = v({
611
+ }), q = "sort-named-imports", ye = O({
600
612
  name: q,
601
613
  meta: {
602
614
  type: "suggestion",
@@ -640,36 +652,36 @@ const J = "sort-array-includes", de = v({
640
652
  order: f.asc
641
653
  }
642
654
  ],
643
- create: (s) => ({
655
+ create: (a) => ({
644
656
  ImportDeclaration: (l) => {
645
- let n = l.specifiers.filter(
646
- ({ type: a }) => a === "ImportSpecifier"
657
+ let s = l.specifiers.filter(
658
+ ({ type: o }) => o === "ImportSpecifier"
647
659
  );
648
- if (n.length > 1) {
649
- let a = k(s.options.at(0), {
660
+ if (s.length > 1) {
661
+ let o = j(a.options.at(0), {
650
662
  type: i.alphabetical,
651
663
  "ignore-case": !1,
652
664
  order: f.asc
653
- }), u = s.getSourceCode(), t = n.map((e) => ({
665
+ }), u = a.getSourceCode(), r = s.map((e) => ({
654
666
  size: w(e.range),
655
667
  name: e.local.name,
656
668
  node: e
657
669
  }));
658
- C(t, (e, o) => {
659
- j(I(e, o, a)) && s.report({
670
+ k(r, (e, t) => {
671
+ v(A(e, t, o)) && a.report({
660
672
  messageId: "unexpectedNamedImportsOrder",
661
673
  data: {
662
674
  left: e.name,
663
- right: o.name
675
+ right: t.name
664
676
  },
665
- node: o.node,
666
- fix: (r) => P(r, t, N(t, a), u)
677
+ node: t.node,
678
+ fix: (n) => C(n, r, S(r, o), u)
667
679
  });
668
680
  });
669
681
  }
670
682
  }
671
683
  })
672
- }), F = "sort-object-types", me = v({
684
+ }), F = "sort-object-types", me = O({
673
685
  name: F,
674
686
  meta: {
675
687
  type: "suggestion",
@@ -720,70 +732,70 @@ const J = "sort-array-includes", de = v({
720
732
  order: f.asc
721
733
  }
722
734
  ],
723
- create: (s) => ({
735
+ create: (a) => ({
724
736
  TSTypeLiteral: (l) => {
725
737
  if (l.members.length > 1) {
726
- let n = k(s.options.at(0), {
738
+ let s = j(a.options.at(0), {
727
739
  type: i.alphabetical,
728
740
  "ignore-case": !1,
729
741
  order: f.asc,
730
742
  "custom-groups": {},
731
743
  groups: []
732
- }), a = s.getSourceCode(), u = l.members.map((t) => {
733
- var p, h;
734
- let e, o = a.text.slice(t.range.at(0), t.range.at(1)), { getGroup: r, defineGroup: c, setCustomGroups: d } = G(
735
- n.groups
736
- ), y = (S) => S.replace(/(,|;)$/, "");
737
- if (t.type === "TSPropertySignature")
738
- t.key.type === "Identifier" ? { name: e } = t.key : t.key.type === "Literal" ? e = `${t.key.value}` : e = a.text.slice(
739
- t.range.at(0),
740
- (p = t.typeAnnotation) == null ? void 0 : p.range.at(0)
744
+ }), o = a.getSourceCode(), u = l.members.map((r) => {
745
+ var y, h;
746
+ let e, t = o.text.slice(r.range.at(0), r.range.at(1)), { getGroup: n, defineGroup: c, setCustomGroups: d } = R(
747
+ s.groups
748
+ ), m = (N) => N.replace(/(,|;)$/, "");
749
+ if (r.type === "TSPropertySignature")
750
+ r.key.type === "Identifier" ? { name: e } = r.key : r.key.type === "Literal" ? e = `${r.key.value}` : e = o.text.slice(
751
+ r.range.at(0),
752
+ (y = r.typeAnnotation) == null ? void 0 : y.range.at(0)
741
753
  );
742
- else if (t.type === "TSIndexSignature") {
743
- let S = ((h = t.typeAnnotation) == null ? void 0 : h.range.at(0)) ?? t.range.at(1);
744
- e = y(a.text.slice(t.range.at(0), S));
754
+ else if (r.type === "TSIndexSignature") {
755
+ let N = ((h = r.typeAnnotation) == null ? void 0 : h.range.at(0)) ?? r.range.at(1);
756
+ e = m(o.text.slice(r.range.at(0), N));
745
757
  } else
746
- e = y(
747
- a.text.slice(t.range.at(0), t.range.at(1))
758
+ e = m(
759
+ o.text.slice(r.range.at(0), r.range.at(1))
748
760
  );
749
- d(n["custom-groups"], e), t.loc.start.line !== t.loc.end.line && c("multiline");
750
- let g = o.endsWith(";") || o.endsWith(",") ? 1 : 0;
761
+ d(s["custom-groups"], e), r.loc.start.line !== r.loc.end.line && c("multiline");
762
+ let p = t.endsWith(";") || t.endsWith(",") ? 1 : 0;
751
763
  return {
752
- size: w(t.range) - g,
753
- group: r(),
754
- node: t,
764
+ size: w(r.range) - p,
765
+ group: n(),
766
+ node: r,
755
767
  name: e
756
768
  };
757
769
  });
758
- C(u, (t, e) => {
759
- let o = x(n.groups, t), r = x(n.groups, e);
760
- (o > r || o === r && j(I(t, e, n))) && s.report({
770
+ k(u, (r, e) => {
771
+ let t = x(s.groups, r), n = x(s.groups, e);
772
+ (t > n || t === n && v(A(r, e, s))) && a.report({
761
773
  messageId: "unexpectedObjectTypesOrder",
762
774
  data: {
763
- left: O(t.name),
764
- right: O(e.name)
775
+ left: I(r.name),
776
+ right: I(e.name)
765
777
  },
766
778
  node: e.node,
767
779
  fix: (c) => {
768
780
  let d = {};
769
- for (let m of u) {
770
- let g = x(n.groups, m);
771
- g in d ? d[g] = N(
772
- [...d[g], m],
773
- n
774
- ) : d[g] = [m];
781
+ for (let g of u) {
782
+ let p = x(s.groups, g);
783
+ p in d ? d[p] = S(
784
+ [...d[p], g],
785
+ s
786
+ ) : d[p] = [g];
775
787
  }
776
- let y = [];
777
- for (let m of Object.keys(d).sort())
778
- y.push(...N(d[m], n));
779
- return P(c, u, y, a);
788
+ let m = [];
789
+ for (let g of Object.keys(d).sort())
790
+ m.push(...S(d[g], s));
791
+ return C(c, u, m, o);
780
792
  }
781
793
  });
782
794
  });
783
795
  }
784
796
  }
785
797
  })
786
- }), H = "sort-union-types", he = v({
798
+ }), H = "sort-union-types", he = O({
787
799
  name: H,
788
800
  meta: {
789
801
  type: "suggestion",
@@ -831,45 +843,45 @@ const J = "sort-array-includes", de = v({
831
843
  order: f.asc
832
844
  }
833
845
  ],
834
- create: (s) => ({
846
+ create: (a) => ({
835
847
  TSUnionType: (l) => {
836
- let n = s.getSourceCode(), a = k(s.options.at(0), {
848
+ let s = a.getSourceCode(), o = j(a.options.at(0), {
837
849
  type: i.alphabetical,
838
850
  "nullable-last": !1,
839
851
  "ignore-case": !1,
840
852
  order: f.asc
841
- }), u = l.types.map((t) => ({
842
- group: t.type === "TSNullKeyword" || t.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
843
- name: n.text.slice(...t.range),
844
- size: w(t.range),
845
- node: t
853
+ }), u = l.types.map((r) => ({
854
+ group: r.type === "TSNullKeyword" || r.type === "TSUndefinedKeyword" ? "nullable" : "unknown",
855
+ name: s.text.slice(...r.range),
856
+ size: w(r.range),
857
+ node: r
846
858
  }));
847
- C(u, (t, e) => {
848
- let o = j(I(t, e, a));
849
- a["nullable-last"] && (t.group === "nullable" && e.group === "unknown" ? o = !0 : t.group === "unknown" && e.group === "nullable" && (o = !1)), o && s.report({
859
+ k(u, (r, e) => {
860
+ let t = v(A(r, e, o));
861
+ o["nullable-last"] && (r.group === "nullable" && e.group === "unknown" ? t = !0 : r.group === "unknown" && e.group === "nullable" && (t = !1)), t && a.report({
850
862
  messageId: "unexpectedUnionTypesOrder",
851
863
  data: {
852
- left: O(t.name),
853
- right: O(e.name)
864
+ left: I(r.name),
865
+ right: I(e.name)
854
866
  },
855
867
  node: e.node,
856
- fix: (r) => {
868
+ fix: (n) => {
857
869
  let c = [];
858
- if (a["nullable-last"]) {
859
- let d = [], y = u.filter((m) => m.group === "nullable" ? (d.push(m), !1) : !0);
870
+ if (o["nullable-last"]) {
871
+ let d = [], m = u.filter((g) => g.group === "nullable" ? (d.push(g), !1) : !0);
860
872
  c = [
861
- ...N(y, a),
862
- ...N(d, a)
873
+ ...S(m, o),
874
+ ...S(d, o)
863
875
  ];
864
876
  } else
865
- c = N(u, a);
866
- return P(r, u, c, n);
877
+ c = S(u, o);
878
+ return C(n, u, c, s);
867
879
  }
868
880
  });
869
881
  });
870
882
  }
871
883
  })
872
- }), Q = "sort-interfaces", be = v({
884
+ }), Q = "sort-interfaces", be = O({
873
885
  name: Q,
874
886
  meta: {
875
887
  type: "suggestion",
@@ -926,10 +938,10 @@ const J = "sort-array-includes", de = v({
926
938
  order: f.asc
927
939
  }
928
940
  ],
929
- create: (s) => ({
941
+ create: (a) => ({
930
942
  TSInterfaceDeclaration: (l) => {
931
943
  if (l.body.body.length > 1) {
932
- let n = k(s.options.at(0), {
944
+ let s = j(a.options.at(0), {
933
945
  type: i.alphabetical,
934
946
  "ignore-case": !1,
935
947
  order: f.asc,
@@ -937,65 +949,67 @@ const J = "sort-array-includes", de = v({
937
949
  "custom-groups": {},
938
950
  groups: []
939
951
  });
940
- if (!n["ignore-pattern"].some(
941
- (a) => $(l.id.name, a)
952
+ if (!s["ignore-pattern"].some(
953
+ (o) => M(l.id.name, o, {
954
+ nocomment: !0
955
+ })
942
956
  )) {
943
- let a = s.getSourceCode(), u = l.body.body.reduce(
944
- (t, e) => {
945
- var y, m, g;
957
+ let o = a.getSourceCode(), u = l.body.body.reduce(
958
+ (r, e) => {
959
+ var m, g, p;
946
960
  if (e.type === "TSCallSignatureDeclaration")
947
- return t.push([]), t;
948
- let o, { getGroup: r, defineGroup: c, setCustomGroups: d } = G(
949
- n.groups
961
+ return r.push([]), r;
962
+ let t, { getGroup: n, defineGroup: c, setCustomGroups: d } = R(
963
+ s.groups
950
964
  );
951
965
  if (e.type === "TSPropertySignature")
952
966
  if (e.key.type === "Identifier")
953
- ({ name: o } = e.key);
967
+ ({ name: t } = e.key);
954
968
  else if (e.key.type === "Literal")
955
- o = `${e.key.value}`;
969
+ t = `${e.key.value}`;
956
970
  else {
957
- let p = ((y = e.typeAnnotation) == null ? void 0 : y.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
958
- o = a.text.slice(e.range.at(0), p);
971
+ let y = ((m = e.typeAnnotation) == null ? void 0 : m.range.at(0)) ?? e.range.at(1) - (e.optional ? 1 : 0);
972
+ t = o.text.slice(e.range.at(0), y);
959
973
  }
960
974
  else if (e.type === "TSIndexSignature") {
961
- let p = ((m = e.typeAnnotation) == null ? void 0 : m.range.at(0)) ?? e.range.at(1);
962
- o = a.text.slice(e.range.at(0), p);
975
+ let y = ((g = e.typeAnnotation) == null ? void 0 : g.range.at(0)) ?? e.range.at(1);
976
+ t = o.text.slice(e.range.at(0), y);
963
977
  } else {
964
- let p = ((g = e.returnType) == null ? void 0 : g.range.at(0)) ?? e.range.at(1);
965
- o = a.text.slice(e.range.at(0), p);
978
+ let y = ((p = e.returnType) == null ? void 0 : p.range.at(0)) ?? e.range.at(1);
979
+ t = o.text.slice(e.range.at(0), y);
966
980
  }
967
- return d(n["custom-groups"], o), e.loc.start.line !== e.loc.end.line && c("multiline"), t.at(-1).push({
981
+ return d(s["custom-groups"], t), e.loc.start.line !== e.loc.end.line && c("multiline"), r.at(-1).push({
968
982
  size: w(e.range),
969
- group: r(),
983
+ group: n(),
970
984
  node: e,
971
- name: o
972
- }), t;
985
+ name: t
986
+ }), r;
973
987
  },
974
988
  [[]]
975
989
  );
976
- for (let t of u)
977
- C(t, (e, o) => {
978
- let r = x(n.groups, e), c = x(n.groups, o);
979
- (r > c || r === c && j(I(e, o, n))) && s.report({
990
+ for (let r of u)
991
+ k(r, (e, t) => {
992
+ let n = x(s.groups, e), c = x(s.groups, t);
993
+ (n > c || n === c && v(A(e, t, s))) && a.report({
980
994
  messageId: "unexpectedInterfacePropertiesOrder",
981
995
  data: {
982
- left: O(e.name),
983
- right: O(o.name)
996
+ left: I(e.name),
997
+ right: I(t.name)
984
998
  },
985
- node: o.node,
999
+ node: t.node,
986
1000
  fix: (d) => {
987
- let y = {};
988
- for (let g of t) {
989
- let p = x(n.groups, g);
990
- p in y ? y[p] = N(
991
- [...y[p], g],
992
- n
993
- ) : y[p] = [g];
1001
+ let m = {};
1002
+ for (let p of r) {
1003
+ let y = x(s.groups, p);
1004
+ y in m ? m[y] = S(
1005
+ [...m[y], p],
1006
+ s
1007
+ ) : m[y] = [p];
994
1008
  }
995
- let m = [];
996
- for (let g of Object.keys(y).sort())
997
- m.push(...N(y[g], n));
998
- return P(d, t, m, a);
1009
+ let g = [];
1010
+ for (let p of Object.keys(m).sort())
1011
+ g.push(...S(m[p], s));
1012
+ return C(d, r, g, o);
999
1013
  }
1000
1014
  });
1001
1015
  });
@@ -1003,7 +1017,7 @@ const J = "sort-array-includes", de = v({
1003
1017
  }
1004
1018
  }
1005
1019
  })
1006
- }), Y = "sort-jsx-props", xe = v({
1020
+ }), Y = "sort-jsx-props", xe = O({
1007
1021
  name: Y,
1008
1022
  meta: {
1009
1023
  type: "suggestion",
@@ -1053,65 +1067,65 @@ const J = "sort-array-includes", de = v({
1053
1067
  order: f.asc
1054
1068
  }
1055
1069
  ],
1056
- create: (s) => [".svelte", ".astro", ".vue"].includes(
1057
- U.extname(s.getFilename())
1070
+ create: (a) => [".svelte", ".astro", ".vue"].includes(
1071
+ U.extname(a.getFilename())
1058
1072
  ) ? {} : {
1059
1073
  JSXElement: (l) => {
1060
1074
  if (l.openingElement.attributes.length > 1) {
1061
- let n = k(s.options.at(0), {
1075
+ let s = j(a.options.at(0), {
1062
1076
  type: i.alphabetical,
1063
1077
  "ignore-case": !1,
1064
1078
  order: f.asc,
1065
1079
  "custom-groups": {},
1066
1080
  groups: []
1067
- }), a = s.getSourceCode(), u = l.openingElement.attributes.reduce(
1068
- (t, e) => {
1081
+ }), o = a.getSourceCode(), u = l.openingElement.attributes.reduce(
1082
+ (r, e) => {
1069
1083
  if (e.type === "JSXSpreadAttribute")
1070
- return t.push([]), t;
1071
- let o = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: r, defineGroup: c, setCustomGroups: d } = G(
1072
- n.groups
1084
+ return r.push([]), r;
1085
+ let t = e.name.type === "JSXNamespacedName" ? `${e.name.namespace.name}:${e.name.name.name}` : e.name.name, { getGroup: n, defineGroup: c, setCustomGroups: d } = R(
1086
+ s.groups
1073
1087
  );
1074
- d(n["custom-groups"], o), e.value === null && c("shorthand"), e.loc.start.line !== e.loc.end.line && c("multiline");
1075
- let y = {
1088
+ d(s["custom-groups"], t), e.value === null && c("shorthand"), e.loc.start.line !== e.loc.end.line && c("multiline");
1089
+ let m = {
1076
1090
  size: w(e.range),
1077
- group: r(),
1091
+ group: n(),
1078
1092
  node: e,
1079
- name: o
1093
+ name: t
1080
1094
  };
1081
- return t.at(-1).push(y), t;
1095
+ return r.at(-1).push(m), r;
1082
1096
  },
1083
1097
  [[]]
1084
1098
  );
1085
- for (let t of u)
1086
- C(t, (e, o) => {
1087
- let r = x(n.groups, e), c = x(n.groups, o);
1088
- (r > c || r === c && j(I(e, o, n))) && s.report({
1099
+ for (let r of u)
1100
+ k(r, (e, t) => {
1101
+ let n = x(s.groups, e), c = x(s.groups, t);
1102
+ (n > c || n === c && v(A(e, t, s))) && a.report({
1089
1103
  messageId: "unexpectedJSXPropsOrder",
1090
1104
  data: {
1091
1105
  left: e.name,
1092
- right: o.name
1106
+ right: t.name
1093
1107
  },
1094
- node: o.node,
1108
+ node: t.node,
1095
1109
  fix: (d) => {
1096
- let y = {};
1097
- for (let g of t) {
1098
- let p = x(n.groups, g);
1099
- p in y ? y[p] = N(
1100
- [...y[p], g],
1101
- n
1102
- ) : y[p] = [g];
1110
+ let m = {};
1111
+ for (let p of r) {
1112
+ let y = x(s.groups, p);
1113
+ y in m ? m[y] = S(
1114
+ [...m[y], p],
1115
+ s
1116
+ ) : m[y] = [p];
1103
1117
  }
1104
- let m = [];
1105
- for (let g of Object.keys(y).sort())
1106
- m.push(...N(y[g], n));
1107
- return P(d, t, m, a);
1118
+ let g = [];
1119
+ for (let p of Object.keys(m).sort())
1120
+ g.push(...S(m[p], s));
1121
+ return C(d, r, g, o);
1108
1122
  }
1109
1123
  });
1110
1124
  });
1111
1125
  }
1112
1126
  }
1113
1127
  }
1114
- }), Z = "sort-exports", Ee = v({
1128
+ }), Z = "sort-exports", Ee = O({
1115
1129
  name: Z,
1116
1130
  meta: {
1117
1131
  type: "suggestion",
@@ -1155,41 +1169,41 @@ const J = "sort-array-includes", de = v({
1155
1169
  order: f.asc
1156
1170
  }
1157
1171
  ],
1158
- create: (s) => {
1159
- let l = k(s.options.at(0), {
1172
+ create: (a) => {
1173
+ let l = j(a.options.at(0), {
1160
1174
  type: i.alphabetical,
1161
1175
  order: f.asc,
1162
1176
  "ignore-case": !1
1163
- }), n = [[]], a = (u) => {
1164
- u.type === "ExportAllDeclaration" && u.exported === null ? n.push([]) : n.at(-1).push({
1177
+ }), s = [[]], o = (u) => {
1178
+ u.type === "ExportAllDeclaration" && u.exported === null ? s.push([]) : s.at(-1).push({
1165
1179
  size: w(u.range),
1166
1180
  name: u.source.value,
1167
1181
  node: u
1168
1182
  });
1169
1183
  };
1170
1184
  return {
1171
- ExportAllDeclaration: a,
1185
+ ExportAllDeclaration: o,
1172
1186
  ExportNamedDeclaration: (u) => {
1173
- u.source !== null && a(u);
1187
+ u.source !== null && o(u);
1174
1188
  },
1175
1189
  "Program:exit": () => {
1176
- let u = s.getSourceCode();
1177
- for (let t of n)
1178
- C(t, (e, o) => {
1179
- j(I(e, o, l)) && s.report({
1190
+ let u = a.getSourceCode();
1191
+ for (let r of s)
1192
+ k(r, (e, t) => {
1193
+ v(A(e, t, l)) && a.report({
1180
1194
  messageId: "unexpectedExportsOrder",
1181
1195
  data: {
1182
1196
  left: e.name,
1183
- right: o.name
1197
+ right: t.name
1184
1198
  },
1185
- node: o.node,
1186
- fix: (r) => P(r, t, N(t, l), u)
1199
+ node: t.node,
1200
+ fix: (n) => C(n, r, S(r, l), u)
1187
1201
  });
1188
1202
  });
1189
1203
  }
1190
1204
  };
1191
1205
  }
1192
- }), ee = "sort-imports", Se = v({
1206
+ }), ee = "sort-imports", Se = O({
1193
1207
  name: ee,
1194
1208
  meta: {
1195
1209
  type: "suggestion",
@@ -1267,8 +1281,8 @@ const J = "sort-array-includes", de = v({
1267
1281
  order: f.asc
1268
1282
  }
1269
1283
  ],
1270
- create: (s) => {
1271
- let l = k(s.options.at(0), {
1284
+ create: (a) => {
1285
+ let l = j(a.options.at(0), {
1272
1286
  "newlines-between": "always",
1273
1287
  "custom-groups": { type: {}, value: {} },
1274
1288
  "internal-pattern": ["~/**"],
@@ -1276,10 +1290,10 @@ const J = "sort-array-includes", de = v({
1276
1290
  order: f.asc,
1277
1291
  "ignore-case": !1,
1278
1292
  groups: []
1279
- }), n = [], a = s.getSourceCode(), u = [], t = (r) => r.type === "ImportDeclaration" && r.specifiers.length === 0, e = (r) => {
1280
- let c = (b) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1293
+ }), s = a.getSourceCode(), o = [], u = (t) => t.type === "ImportDeclaration" && t.specifiers.length === 0, r = (t) => {
1294
+ let n = (b) => [".less", ".scss", ".sass", ".styl", ".pcss", ".css", ".sss"].some(
1281
1295
  (E) => b.endsWith(E)
1282
- ), d = (b) => [
1296
+ ), c = (b) => [
1283
1297
  "./index.d.js",
1284
1298
  "./index.d.ts",
1285
1299
  "./index.js",
@@ -1287,84 +1301,99 @@ const J = "sort-array-includes", de = v({
1287
1301
  "./index",
1288
1302
  "./",
1289
1303
  "."
1290
- ].includes(b), y = (b) => b.indexOf("..") === 0, m = (b) => b.indexOf("./") === 0, { getGroup: g, defineGroup: p, setCustomGroups: h } = G(l.groups), S = (b) => l["internal-pattern"].length && l["internal-pattern"].some(
1291
- (E) => $(b.source.value, E)
1292
- ) || n.some((E) => $(b.source.value, E)), A = (b) => ie.includes(
1293
- b.startsWith("node:") ? b.split("node:")[1] : b
1294
- );
1295
- return r.importKind === "type" && (r.type === "ImportDeclaration" && (h(l["custom-groups"].type, r.source.value), A(r.source.value) && p("builtin-type"), S(r) && p("internal-type"), d(r.source.value) && p("index-type"), y(r.source.value) && p("parent-type"), m(r.source.value) && p("sibling-type")), p("external-type"), p("type")), r.type === "ImportDeclaration" && (h(l["custom-groups"].value, r.source.value), A(r.source.value) && p("builtin"), S(r) && p("internal"), c(r.source.value) && p("style"), t(r) && p("side-effect"), d(r.source.value) && p("index"), y(r.source.value) && p("parent"), m(r.source.value) && p("sibling"), p("external")), g();
1296
- }, o = (r) => {
1297
- let c;
1298
- r.type === "ImportDeclaration" ? c = r.source.value : r.moduleReference.type === "TSExternalModuleReference" && r.moduleReference.expression.type === "Literal" ? c = `${r.moduleReference.expression.value}` : c = a.text.slice(...r.moduleReference.range), u.push({
1299
- size: w(r.range),
1300
- group: e(r),
1301
- name: c,
1302
- node: r
1304
+ ].includes(b), d = (b) => b.indexOf("..") === 0, m = (b) => b.indexOf("./") === 0, { getGroup: g, defineGroup: p, setCustomGroups: y } = R(l.groups), h = (b) => l["internal-pattern"].length && l["internal-pattern"].some(
1305
+ (E) => M(b.source.value, E, {
1306
+ nocomment: !0
1307
+ })
1308
+ ), N = (b) => {
1309
+ let E = [
1310
+ "bun",
1311
+ "bun:ffi",
1312
+ "bun:jsc",
1313
+ "bun:sqlite",
1314
+ "bun:test",
1315
+ "bun:wrap",
1316
+ "detect-libc",
1317
+ "undici",
1318
+ "ws"
1319
+ ];
1320
+ return ie.includes(
1321
+ b.startsWith("node:") ? b.split("node:")[1] : b
1322
+ ) || E.includes(b);
1323
+ };
1324
+ return t.importKind === "type" && (t.type === "ImportDeclaration" && (y(l["custom-groups"].type, t.source.value), N(t.source.value) && p("builtin-type"), h(t) && p("internal-type"), c(t.source.value) && p("index-type"), d(t.source.value) && p("parent-type"), m(t.source.value) && p("sibling-type")), p("external-type"), p("type")), t.type === "ImportDeclaration" && (y(l["custom-groups"].value, t.source.value), N(t.source.value) && p("builtin"), h(t) && p("internal"), n(t.source.value) && p("style"), u(t) && p("side-effect"), c(t.source.value) && p("index"), d(t.source.value) && p("parent"), m(t.source.value) && p("sibling"), p("external")), g();
1325
+ }, e = (t) => {
1326
+ let n;
1327
+ t.type === "ImportDeclaration" ? n = t.source.value : t.moduleReference.type === "TSExternalModuleReference" && t.moduleReference.expression.type === "Literal" ? n = `${t.moduleReference.expression.value}` : n = s.text.slice(...t.moduleReference.range), o.push({
1328
+ size: w(t.range),
1329
+ group: r(t),
1330
+ name: n,
1331
+ node: t
1303
1332
  });
1304
1333
  };
1305
1334
  return {
1306
- TSImportEqualsDeclaration: o,
1307
- ImportDeclaration: o,
1335
+ TSImportEqualsDeclaration: e,
1336
+ ImportDeclaration: e,
1308
1337
  "Program:exit": () => {
1309
1338
  var m;
1310
- let r = (g, p) => !!a.getTokensBetween(
1339
+ let t = (g, p) => !!s.getTokensBetween(
1311
1340
  g.node,
1312
- _(p.node, a) || p.node,
1341
+ _(p.node, s) || p.node,
1313
1342
  {
1314
1343
  includeComments: !0
1315
1344
  }
1316
- ).length, c = (g, p) => a.lines.slice(
1345
+ ).length, n = (g, p) => s.lines.slice(
1317
1346
  g.node.loc.end.line,
1318
1347
  p.node.loc.start.line - 1
1319
- ).filter((S) => !S.trim().length).length, d = (g, p) => {
1320
- let h = [], S = {};
1348
+ ).filter((h) => !h.trim().length).length, c = (g, p) => {
1349
+ let y = [], h = {};
1321
1350
  for (let b of p) {
1322
1351
  let E = x(l.groups, b);
1323
- E in S ? S[E] = N(
1324
- [...S[E], b],
1352
+ E in h ? h[E] = S(
1353
+ [...h[E], b],
1325
1354
  l
1326
- ) : S[E] = [b];
1355
+ ) : h[E] = [b];
1327
1356
  }
1328
- let A = Object.keys(S).sort().reduce(
1357
+ let N = Object.keys(h).sort().reduce(
1329
1358
  (b, E) => [
1330
1359
  ...b,
1331
- ...S[E]
1360
+ ...h[E]
1332
1361
  ],
1333
1362
  []
1334
1363
  );
1335
- for (let b = 0, E = A.length; b < E; b++) {
1336
- let M = A.at(b);
1337
- if (h.push(
1364
+ for (let b = 0, E = N.length; b < E; b++) {
1365
+ let L = N.at(b);
1366
+ if (y.push(
1338
1367
  g.replaceTextRange(
1339
- L(p.at(b).node, a),
1340
- a.text.slice(...L(M.node, a))
1368
+ T(p.at(b).node, s),
1369
+ s.text.slice(...T(L.node, s))
1341
1370
  )
1342
1371
  ), l["newlines-between"] !== "ignore") {
1343
- let T = A.at(b + 1);
1344
- if (T) {
1345
- let R = c(
1372
+ let G = N.at(b + 1);
1373
+ if (G) {
1374
+ let P = n(
1346
1375
  p.at(b),
1347
1376
  p.at(b + 1)
1348
1377
  );
1349
- (l["newlines-between"] === "always" && x(l.groups, M) === x(l.groups, T) && R !== 0 || l["newlines-between"] === "never" && R > 0) && h.push(
1378
+ (l["newlines-between"] === "always" && x(l.groups, L) === x(l.groups, G) && P !== 0 || l["newlines-between"] === "never" && P > 0) && y.push(
1350
1379
  g.removeRange([
1351
- L(p.at(b).node, a).at(1),
1352
- L(p.at(b + 1).node, a).at(0) - 1
1380
+ T(p.at(b).node, s).at(1),
1381
+ T(p.at(b + 1).node, s).at(0) - 1
1353
1382
  ])
1354
- ), l["newlines-between"] === "always" && x(l.groups, M) !== x(l.groups, T) && R > 1 && h.push(
1383
+ ), l["newlines-between"] === "always" && x(l.groups, L) !== x(l.groups, G) && P > 1 && y.push(
1355
1384
  g.replaceTextRange(
1356
1385
  [
1357
- L(p.at(b).node, a).at(1),
1358
- L(p.at(b + 1).node, a).at(
1386
+ T(p.at(b).node, s).at(1),
1387
+ T(p.at(b + 1).node, s).at(
1359
1388
  0
1360
1389
  ) - 1
1361
1390
  ],
1362
1391
  `
1363
1392
  `
1364
1393
  )
1365
- ), l["newlines-between"] === "always" && x(l.groups, M) !== x(l.groups, T) && R === 0 && h.push(
1394
+ ), l["newlines-between"] === "always" && x(l.groups, L) !== x(l.groups, G) && P === 0 && y.push(
1366
1395
  g.insertTextAfterRange(
1367
- L(p.at(b).node, a),
1396
+ T(p.at(b).node, s),
1368
1397
  `
1369
1398
  `
1370
1399
  )
@@ -1372,53 +1401,53 @@ const J = "sort-array-includes", de = v({
1372
1401
  }
1373
1402
  }
1374
1403
  }
1375
- return h;
1376
- }, y = [[]];
1377
- for (let g of u) {
1378
- let p = (m = y.at(-1)) == null ? void 0 : m.at(-1);
1379
- p && r(p, g) ? y.push([g]) : y.at(-1).push(g);
1404
+ return y;
1405
+ }, d = [[]];
1406
+ for (let g of o) {
1407
+ let p = (m = d.at(-1)) == null ? void 0 : m.at(-1);
1408
+ p && t(p, g) ? d.push([g]) : d.at(-1).push(g);
1380
1409
  }
1381
- for (let g of y)
1382
- C(g, (p, h) => {
1383
- let S = x(l.groups, p), A = x(l.groups, h), b = c(p, h);
1384
- !(t(p.node) && t(h.node)) && !r(p, h) && (S > A || S === A && j(I(p, h, l))) && s.report({
1410
+ for (let g of d)
1411
+ k(g, (p, y) => {
1412
+ let h = x(l.groups, p), N = x(l.groups, y), b = n(p, y);
1413
+ !(u(p.node) && u(y.node)) && !t(p, y) && (h > N || h === N && v(A(p, y, l))) && a.report({
1385
1414
  messageId: "unexpectedImportsOrder",
1386
1415
  data: {
1387
1416
  left: p.name,
1388
- right: h.name
1417
+ right: y.name
1389
1418
  },
1390
- node: h.node,
1391
- fix: (E) => d(E, g)
1392
- }), l["newlines-between"] === "never" && b > 0 && s.report({
1419
+ node: y.node,
1420
+ fix: (E) => c(E, g)
1421
+ }), l["newlines-between"] === "never" && b > 0 && a.report({
1393
1422
  messageId: "extraSpacingBetweenImports",
1394
1423
  data: {
1395
1424
  left: p.name,
1396
- right: h.name
1425
+ right: y.name
1397
1426
  },
1398
- node: h.node,
1399
- fix: (E) => d(E, g)
1400
- }), l["newlines-between"] === "always" && (S < A && b === 0 ? s.report({
1427
+ node: y.node,
1428
+ fix: (E) => c(E, g)
1429
+ }), l["newlines-between"] === "always" && (h < N && b === 0 ? a.report({
1401
1430
  messageId: "missedSpacingBetweenImports",
1402
1431
  data: {
1403
1432
  left: p.name,
1404
- right: h.name
1433
+ right: y.name
1405
1434
  },
1406
- node: h.node,
1407
- fix: (E) => d(E, g)
1408
- }) : (b > 1 || S === A && b > 0) && s.report({
1435
+ node: y.node,
1436
+ fix: (E) => c(E, g)
1437
+ }) : (b > 1 || h === N && b > 0) && a.report({
1409
1438
  messageId: "extraSpacingBetweenImports",
1410
1439
  data: {
1411
1440
  left: p.name,
1412
- right: h.name
1441
+ right: y.name
1413
1442
  },
1414
- node: h.node,
1415
- fix: (E) => d(E, g)
1443
+ node: y.node,
1444
+ fix: (E) => c(E, g)
1416
1445
  }));
1417
1446
  });
1418
1447
  }
1419
1448
  };
1420
1449
  }
1421
- }), te = "sort-objects", Ne = v({
1450
+ }), te = "sort-objects", Ne = O({
1422
1451
  name: te,
1423
1452
  meta: {
1424
1453
  type: "suggestion",
@@ -1476,10 +1505,10 @@ const J = "sort-array-includes", de = v({
1476
1505
  order: f.asc
1477
1506
  }
1478
1507
  ],
1479
- create: (s) => {
1480
- let l = (n) => {
1481
- if (n.properties.length > 1) {
1482
- let a = k(s.options.at(0), {
1508
+ create: (a) => {
1509
+ let l = (s) => {
1510
+ if (s.properties.length > 1) {
1511
+ let o = j(a.options.at(0), {
1483
1512
  "partition-by-comment": !1,
1484
1513
  type: i.alphabetical,
1485
1514
  "styled-components": !0,
@@ -1487,92 +1516,92 @@ const J = "sort-array-includes", de = v({
1487
1516
  order: f.asc,
1488
1517
  "custom-groups": {},
1489
1518
  groups: []
1490
- }), u = (r) => r.type === "Identifier" && r.name === "styled", t = (r) => r !== void 0 && r.type === "CallExpression" && (r.callee.type === "MemberExpression" && u(r.callee.object) || r.callee.type === "CallExpression" && u(r.callee.callee));
1491
- if (!a["styled-components"] && (t(n.parent) || n.parent.type === "ArrowFunctionExpression" && t(n.parent.parent)))
1519
+ }), u = (n) => n.type === "Identifier" && n.name === "styled", r = (n) => n !== void 0 && n.type === "CallExpression" && (n.callee.type === "MemberExpression" && u(n.callee.object) || n.callee.type === "CallExpression" && u(n.callee.callee));
1520
+ if (!o["styled-components"] && (r(s.parent) || s.parent.type === "ArrowFunctionExpression" && r(s.parent.parent)))
1492
1521
  return;
1493
- let e = s.getSourceCode(), o = (r) => r.reduce(
1522
+ let e = a.getSourceCode(), t = (n) => n.reduce(
1494
1523
  (c, d) => {
1495
1524
  if (d.type === "SpreadElement" || d.type === "RestElement")
1496
1525
  return c.push([]), c;
1497
- let y = _(d, e);
1498
- a["partition-by-comment"] && y && oe(
1499
- a["partition-by-comment"],
1500
- y.value
1526
+ let m = _(d, e);
1527
+ o["partition-by-comment"] && m && oe(
1528
+ o["partition-by-comment"],
1529
+ m.value
1501
1530
  ) && c.push([]);
1502
- let m, g = "ignore", p = [], { getGroup: h, setCustomGroups: S } = G(a.groups);
1503
- d.key.type === "Identifier" ? { name: m } = d.key : d.key.type === "Literal" ? m = `${d.key.value}` : m = e.text.slice(...d.key.range), d.value.type === "AssignmentPattern" && ((E) => {
1504
- E.right.type === "Identifier" && p.push(E.right.name);
1505
- let M = (T) => {
1506
- let R = [];
1507
- switch (T.type) {
1531
+ let g, p = "ignore", y = [], { getGroup: h, setCustomGroups: N } = R(o.groups);
1532
+ d.key.type === "Identifier" ? { name: g } = d.key : d.key.type === "Literal" ? g = `${d.key.value}` : g = e.text.slice(...d.key.range), d.value.type === "AssignmentPattern" && ((L) => {
1533
+ L.right.type === "Identifier" && y.push(L.right.name);
1534
+ let G = (P) => {
1535
+ let $ = [];
1536
+ switch (P.type) {
1508
1537
  case "ArrowFunctionExpression":
1509
- R.push(T.body);
1538
+ $.push(P.body);
1510
1539
  break;
1511
1540
  case "ConditionalExpression":
1512
- R.push(T.consequent, T.alternate);
1541
+ $.push(P.consequent, P.alternate);
1513
1542
  break;
1514
1543
  case "LogicalExpression":
1515
1544
  case "BinaryExpression":
1516
- R.push(T.left, T.right);
1545
+ $.push(P.left, P.right);
1517
1546
  break;
1518
1547
  case "CallExpression":
1519
- R.push(...T.arguments);
1548
+ $.push(...P.arguments);
1520
1549
  break;
1521
1550
  }
1522
- R.forEach((B) => {
1523
- B.type === "Identifier" && p.push(B.name), (B.type === "BinaryExpression" || B.type === "ConditionalExpression") && M(B);
1551
+ $.forEach((B) => {
1552
+ B.type === "Identifier" && y.push(B.name), (B.type === "BinaryExpression" || B.type === "ConditionalExpression") && G(B);
1524
1553
  });
1525
1554
  };
1526
- switch (E.right.type) {
1555
+ switch (L.right.type) {
1527
1556
  case "ArrowFunctionExpression":
1528
1557
  case "ConditionalExpression":
1529
1558
  case "LogicalExpression":
1530
1559
  case "BinaryExpression":
1531
1560
  case "CallExpression":
1532
- M(E.right);
1561
+ G(L.right);
1533
1562
  break;
1534
1563
  }
1535
- })(d.value), S(a["custom-groups"], m);
1536
- let A = {
1564
+ })(d.value), N(o["custom-groups"], g);
1565
+ let b = {
1537
1566
  size: w(d.range),
1538
1567
  group: h(),
1539
- dependencies: p,
1568
+ dependencies: y,
1540
1569
  node: d,
1541
- position: g,
1542
- name: m
1570
+ position: p,
1571
+ name: g
1543
1572
  };
1544
- return c.at(-1).push(A), c;
1573
+ return c.at(-1).push(b), c;
1545
1574
  },
1546
1575
  [[]]
1547
1576
  );
1548
- for (let r of o(n.properties))
1549
- C(r, (c, d) => {
1550
- let y = x(a.groups, c), m = x(a.groups, d);
1551
- if (y > m || y === m && j(I(c, d, a))) {
1552
- let g = (p) => {
1577
+ for (let n of t(s.properties))
1578
+ k(n, (c, d) => {
1579
+ let m = x(o.groups, c), g = x(o.groups, d);
1580
+ if (m > g || m === g && v(A(c, d, o))) {
1581
+ let p = (y) => {
1553
1582
  let h = {};
1554
- for (let A of r) {
1555
- let b = x(a.groups, A);
1556
- b in h ? h[b] = N(
1557
- [...h[b], A],
1558
- a
1559
- ) : h[b] = [A];
1583
+ for (let b of n) {
1584
+ let E = x(o.groups, b);
1585
+ E in h ? h[E] = S(
1586
+ [...h[E], b],
1587
+ o
1588
+ ) : h[E] = [b];
1560
1589
  }
1561
- let S = [];
1562
- for (let A of Object.keys(h).sort())
1563
- S.push(...N(h[A], a));
1564
- return P(p, r, S, e, {
1565
- partitionComment: a["partition-by-comment"]
1590
+ let N = [];
1591
+ for (let b of Object.keys(h).sort())
1592
+ N.push(...S(h[b], o));
1593
+ return C(y, n, N, e, {
1594
+ partitionComment: o["partition-by-comment"]
1566
1595
  });
1567
1596
  };
1568
- s.report({
1597
+ a.report({
1569
1598
  messageId: "unexpectedObjectsOrder",
1570
1599
  data: {
1571
- left: O(c.name),
1572
- right: O(d.name)
1600
+ left: I(c.name),
1601
+ right: I(d.name)
1573
1602
  },
1574
1603
  node: d.node,
1575
- fix: g
1604
+ fix: p
1576
1605
  });
1577
1606
  }
1578
1607
  });
@@ -1583,7 +1612,7 @@ const J = "sort-array-includes", de = v({
1583
1612
  ObjectPattern: l
1584
1613
  };
1585
1614
  }
1586
- }), re = "sort-classes", Ae = v({
1615
+ }), re = "sort-classes", Ae = O({
1587
1616
  name: re,
1588
1617
  meta: {
1589
1618
  type: "suggestion",
@@ -1631,61 +1660,67 @@ const J = "sort-array-includes", de = v({
1631
1660
  order: f.asc
1632
1661
  }
1633
1662
  ],
1634
- create: (s) => ({
1663
+ create: (a) => ({
1635
1664
  ClassBody: (l) => {
1636
1665
  if (l.body.length > 1) {
1637
- let n = k(s.options.at(0), {
1666
+ let s = j(a.options.at(0), {
1638
1667
  type: i.alphabetical,
1639
1668
  order: f.asc,
1640
1669
  "ignore-case": !1,
1641
1670
  groups: ["property", "constructor", "method", "unknown"]
1642
- }), a = s.getSourceCode(), u = l.body.map((t) => {
1671
+ }), o = a.getSourceCode(), u = l.body.map((r) => {
1643
1672
  var d;
1644
- let e, { getGroup: o, defineGroup: r } = G(n.groups);
1645
- t.type === "StaticBlock" ? e = "static" : t.type === "TSIndexSignature" ? e = a.text.slice(
1646
- t.range.at(0),
1647
- ((d = t.typeAnnotation) == null ? void 0 : d.range.at(0)) ?? t.range.at(1)
1648
- ) : t.key.type === "Identifier" ? { name: e } = t.key : e = a.text.slice(...t.key.range);
1673
+ let e, { getGroup: t, defineGroup: n } = R(s.groups);
1674
+ r.type === "StaticBlock" ? e = "static" : r.type === "TSIndexSignature" ? e = o.text.slice(
1675
+ r.range.at(0),
1676
+ ((d = r.typeAnnotation) == null ? void 0 : d.range.at(0)) ?? r.range.at(1)
1677
+ ) : r.key.type === "Identifier" ? { name: e } = r.key : e = o.text.slice(...r.key.range);
1649
1678
  let c = e.startsWith("_") || e.startsWith("#");
1650
- return t.type === "MethodDefinition" ? (t.kind === "constructor" && r("constructor"), (t.accessibility === "private" || c) && r("private-method"), t.static && r("static-method"), t.kind === "get" && r("get-method"), t.kind === "set" && r("set-method"), r("method")) : t.type === "TSIndexSignature" ? r("index-signature") : t.type === "PropertyDefinition" && ((t.accessibility === "private" || c) && r("private-property"), t.static && r("static-property"), r("property")), {
1651
- size: w(t.range),
1652
- group: o(),
1653
- node: t,
1679
+ if (r.type === "MethodDefinition") {
1680
+ r.kind === "constructor" && n("constructor");
1681
+ let m = r.accessibility === "private" || c, g = r.static;
1682
+ m && g && n("static-private-method"), m && n("private-method"), g && n("static-method"), r.kind === "get" && n("get-method"), r.kind === "set" && n("set-method"), n("method");
1683
+ } else
1684
+ r.type === "TSIndexSignature" ? n("index-signature") : r.type === "PropertyDefinition" && ((r.accessibility === "private" || c) && n("private-property"), r.static && n("static-property"), n("property"));
1685
+ return {
1686
+ size: w(r.range),
1687
+ group: t(),
1688
+ node: r,
1654
1689
  name: e
1655
1690
  };
1656
1691
  });
1657
- C(u, (t, e) => {
1658
- let o = x(n.groups, t), r = x(n.groups, e);
1659
- t.name !== e.name && (o > r || o === r && j(I(t, e, n))) && s.report({
1692
+ k(u, (r, e) => {
1693
+ let t = x(s.groups, r), n = x(s.groups, e);
1694
+ r.name !== e.name && (t > n || t === n && v(A(r, e, s))) && a.report({
1660
1695
  messageId: "unexpectedClassesOrder",
1661
1696
  data: {
1662
- left: O(t.name),
1663
- right: O(e.name)
1697
+ left: I(r.name),
1698
+ right: I(e.name)
1664
1699
  },
1665
1700
  node: e.node,
1666
1701
  fix: (c) => {
1667
- let d = [], y = u.reduce(
1668
- (g, p) => {
1669
- let h = x(n.groups, p);
1670
- return h in g ? g[h] = N(
1671
- [...g[h], p],
1672
- n
1673
- ) : g[h] = [p], g;
1702
+ let d = [], m = u.reduce(
1703
+ (p, y) => {
1704
+ let h = x(s.groups, y);
1705
+ return h in p ? p[h] = S(
1706
+ [...p[h], y],
1707
+ s
1708
+ ) : p[h] = [y], p;
1674
1709
  },
1675
1710
  {}
1676
- ), m = Object.keys(y).sort().reduce(
1677
- (g, p) => [
1678
- ...g,
1679
- ...y[p]
1711
+ ), g = Object.keys(m).sort().reduce(
1712
+ (p, y) => [
1713
+ ...p,
1714
+ ...m[y]
1680
1715
  ],
1681
1716
  []
1682
1717
  );
1683
- for (let g = 0, p = m.length; g < p; g++)
1718
+ for (let p = 0, y = g.length; p < y; p++)
1684
1719
  d.push(
1685
1720
  c.replaceTextRange(
1686
- L(u.at(g).node, a),
1687
- a.text.slice(
1688
- ...L(m.at(g).node, a)
1721
+ T(u.at(p).node, o),
1722
+ o.text.slice(
1723
+ ...T(g.at(p).node, o)
1689
1724
  )
1690
1725
  )
1691
1726
  );
@@ -1696,7 +1731,7 @@ const J = "sort-array-includes", de = v({
1696
1731
  }
1697
1732
  }
1698
1733
  })
1699
- }), se = "sort-enums", Ie = v({
1734
+ }), se = "sort-enums", Ie = O({
1700
1735
  name: se,
1701
1736
  meta: {
1702
1737
  type: "suggestion",
@@ -1740,33 +1775,33 @@ const J = "sort-array-includes", de = v({
1740
1775
  order: f.asc
1741
1776
  }
1742
1777
  ],
1743
- create: (s) => ({
1778
+ create: (a) => ({
1744
1779
  TSEnumDeclaration: (l) => {
1745
- if (l.members.length > 1 && l.members.every(({ initializer: n }) => n)) {
1746
- let n = k(s.options.at(0), {
1780
+ if (l.members.length > 1 && l.members.every(({ initializer: s }) => s)) {
1781
+ let s = j(a.options.at(0), {
1747
1782
  type: i.alphabetical,
1748
1783
  order: f.asc,
1749
1784
  "ignore-case": !1
1750
- }), a = s.getSourceCode(), u = l.members.map((t) => ({
1751
- name: t.id.type === "Literal" ? `${t.id.value}` : `${a.text.slice(...t.id.range)}`,
1752
- size: w(t.range),
1753
- node: t
1785
+ }), o = a.getSourceCode(), u = l.members.map((r) => ({
1786
+ name: r.id.type === "Literal" ? `${r.id.value}` : `${o.text.slice(...r.id.range)}`,
1787
+ size: w(r.range),
1788
+ node: r
1754
1789
  }));
1755
- C(u, (t, e) => {
1756
- j(I(t, e, n)) && s.report({
1790
+ k(u, (r, e) => {
1791
+ v(A(r, e, s)) && a.report({
1757
1792
  messageId: "unexpectedEnumsOrder",
1758
1793
  data: {
1759
- left: O(t.name),
1760
- right: O(e.name)
1794
+ left: I(r.name),
1795
+ right: I(e.name)
1761
1796
  },
1762
1797
  node: e.node,
1763
- fix: (o) => P(o, u, N(u, n), a)
1798
+ fix: (t) => C(t, u, S(u, s), o)
1764
1799
  });
1765
1800
  });
1766
1801
  }
1767
1802
  }
1768
1803
  })
1769
- }), ae = "sort-maps", Oe = v({
1804
+ }), ae = "sort-maps", Oe = O({
1770
1805
  name: ae,
1771
1806
  meta: {
1772
1807
  type: "suggestion",
@@ -1810,42 +1845,42 @@ const J = "sort-array-includes", de = v({
1810
1845
  order: f.asc
1811
1846
  }
1812
1847
  ],
1813
- create: (s) => ({
1848
+ create: (a) => ({
1814
1849
  NewExpression: (l) => {
1815
1850
  if (l.callee.type === "Identifier" && l.callee.name === "Map" && l.arguments.length && l.arguments[0].type === "ArrayExpression") {
1816
- let [{ elements: n }] = l.arguments;
1817
- if (n.length > 1) {
1818
- let a = k(s.options.at(0), {
1851
+ let [{ elements: s }] = l.arguments;
1852
+ if (s.length > 1) {
1853
+ let o = j(a.options.at(0), {
1819
1854
  type: i.alphabetical,
1820
1855
  "ignore-case": !1,
1821
1856
  order: f.asc
1822
- }), u = s.getSourceCode(), t = n.reduce(
1823
- (e, o) => (o === null || o.type === "SpreadElement" ? e.push([]) : e.at(-1).push(o), e),
1857
+ }), u = a.getSourceCode(), r = s.reduce(
1858
+ (e, t) => (t === null || t.type === "SpreadElement" ? e.push([]) : e.at(-1).push(t), e),
1824
1859
  [[]]
1825
1860
  );
1826
- for (let e of t) {
1827
- let o = e.map((r) => {
1861
+ for (let e of r) {
1862
+ let t = e.map((n) => {
1828
1863
  let c;
1829
- if (r.type === "ArrayExpression") {
1830
- let [d] = r.elements;
1864
+ if (n.type === "ArrayExpression") {
1865
+ let [d] = n.elements;
1831
1866
  d ? d.type === "Literal" ? c = d.raw : c = u.text.slice(...d.range) : c = `${d}`;
1832
1867
  } else
1833
- c = u.text.slice(...r.range);
1868
+ c = u.text.slice(...n.range);
1834
1869
  return {
1835
- size: w(r.range),
1836
- node: r,
1870
+ size: w(n.range),
1871
+ node: n,
1837
1872
  name: c
1838
1873
  };
1839
1874
  });
1840
- C(o, (r, c) => {
1841
- j(I(r, c, a)) && s.report({
1875
+ k(t, (n, c) => {
1876
+ v(A(n, c, o)) && a.report({
1842
1877
  messageId: "unexpectedMapElementsOrder",
1843
1878
  data: {
1844
- left: O(r.name),
1845
- right: O(c.name)
1879
+ left: I(n.name),
1880
+ right: I(c.name)
1846
1881
  },
1847
1882
  node: c.node,
1848
- fix: (d) => P(d, o, N(o, a), u)
1883
+ fix: (d) => C(d, t, S(t, o), u)
1849
1884
  });
1850
1885
  });
1851
1886
  }
@@ -1853,8 +1888,8 @@ const J = "sort-array-includes", de = v({
1853
1888
  }
1854
1889
  }
1855
1890
  })
1856
- }), ve = "eslint-plugin-perfectionist";
1857
- let z = (s) => {
1891
+ }), we = "eslint-plugin-perfectionist";
1892
+ let z = (a) => {
1858
1893
  let l = {
1859
1894
  [ee]: [
1860
1895
  "error",
@@ -1921,9 +1956,9 @@ let z = (s) => {
1921
1956
  };
1922
1957
  return {
1923
1958
  rules: Object.fromEntries(
1924
- Object.entries(l).map(([n, [a, u = {}]]) => [
1925
- `perfectionist/${n}`,
1926
- [a, Object.assign(u, s)]
1959
+ Object.entries(l).map(([s, [o, u = {}]]) => [
1960
+ `perfectionist/${s}`,
1961
+ [o, Object.assign(u, a)]
1927
1962
  ])
1928
1963
  ),
1929
1964
  plugins: ["perfectionist"]
@@ -1964,7 +1999,7 @@ const Te = {
1964
1999
  order: f.desc
1965
2000
  })
1966
2001
  },
1967
- name: ve
2002
+ name: we
1968
2003
  };
1969
2004
  export {
1970
2005
  Te as default