eslint-plugin-perfectionist 0.2.0 → 0.3.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.js CHANGED
@@ -1 +1 @@
1
- "use strict";const u=require("@typescript-eslint/types"),h=require("@typescript-eslint/utils"),y="eslint-plugin-perfectionist",_="azat-io/eslint-plugin-perfectionist";let S=h.ESLintUtils.RuleCreator(a=>`https://github.com/${_}/blob/main/docs/rules/${a}.md`),g=a=>{let[i,o]=a;return o-i},I=(a,i,o)=>{let e=[...o].sort((t,r)=>r.size-t.size),s=t=>[t.range.at(0),t.range.at(1)];return o.map(({node:t},r)=>a.replaceTextRange(s(t),i.slice(...s(e[r].node))))};const E="sort-interfaces",z=S({name:E,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedInterfacePropertiesOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[]},defaultOptions:[],create:a=>({TSInterfaceBody:i=>{let o=i.body.map(e=>{let s="",t=0,r=n=>{t+=n},d=n=>{r(g(n.key.range))},f=n=>{let{length:p}="[]";r(n.parameters.reduce((x,{range:O})=>x+g(O),p))},c=n=>{if(n.optional){let{length:p}="?";r(p)}},m=n=>{var x;let p=(x=n.typeAnnotation)==null?void 0:x.range;p&&r(g(p))},l=n=>{if(n.type===u.AST_NODE_TYPES.Identifier)({name:s}=n);else if(n.type===u.AST_NODE_TYPES.TSIndexSignature){let p=n.parameters.at(0);p&&l(p)}};return e.type===u.AST_NODE_TYPES.TSPropertySignature?(l(e.key),d(e),c(e),m(e)):e.type===u.AST_NODE_TYPES.TSIndexSignature&&(l(e),f(e),m(e)),{node:e,name:s,size:t}});for(let e=1;e<o.length;e++){let s=e-1,t=e,r=o.at(s),d=o.at(t);if(r.size<d.size){let f=i.body[t];a.report({messageId:"unexpectedInterfacePropertiesOrder",data:{first:r.name,second:d.name},node:f,fix:c=>{let m=a.getSourceCode(),{text:l}=m;return I(c,l,o)}})}}}})}),T="sort-jsx-props",A=S({name:T,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedJSXPropsOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[]},defaultOptions:[],create:a=>({JSXElement:i=>{i.openingElement.attributes.reduce((e,s)=>(s.type==="JSXAttribute"?e.at(-1).push(s):e.push([]),e),[[]]).forEach(e=>{let s=e.map(t=>({name:t.name.type===u.AST_NODE_TYPES.JSXNamespacedName?`${t.name.namespace.name}:${t.name.name.name}`:t.name.name,size:g(t.range),node:t}));for(let t=1;t<s.length;t++){let r=t-1,d=t,f=s.at(r),c=s.at(d);f.size<c.size&&a.report({messageId:"unexpectedJSXPropsOrder",data:{first:f.name,second:c.name},node:c.node,fix:m=>{let l=a.getSourceCode(),{text:n}=l;return I(m,n,s)}})}})}})}),N="sort-named-imports",P=S({name:N,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedNamedImportsOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[]},defaultOptions:[],create:a=>({ImportDeclaration:i=>{if(i.specifiers.length>1){let o=i.specifiers.map(e=>{let{range:s,local:{name:t}}=e;return{size:g(s),node:e,name:t}});for(let e=1;e<o.length;e++){let s=e-1,t=e,r=o.at(s),d=o.at(t);if(r.size<d.size){let f=i.specifiers[t];a.report({messageId:"unexpectedNamedImportsOrder",data:{first:r.name,second:d.name},node:f,fix:c=>{let m=a.getSourceCode(),{text:l}=m;return I(c,l,o)}})}}}}})}),R={name:y,rules:{[E]:z,[T]:A,[N]:P}};module.exports=R;
1
+ "use strict";const x=require("@typescript-eslint/types"),R=require("@typescript-eslint/utils"),j=require("natural-compare-lite"),C="eslint-plugin-perfectionist",D="azat-io/eslint-plugin-perfectionist";let E=R.ESLintUtils.RuleCreator(t=>`https://github.com/${D}/blob/main/docs/rules/${t}.md`),S=t=>{let[s,a]=t;return a-s};var d=(t=>(t.natural="natural",t["line-length"]="line-length",t))(d||{}),c=(t=>(t.asc="asc",t.desc="desc",t))(c||{});let I=(t,s,a)=>(a.order==="asc"?1:-1)*(a.type===d.natural?j(t.name,s.name):t.size-s.size)>0,O=(t,s,a,l)=>{let e=[...a].sort((r,o)=>Number(I(r,o,l))||-1),n=r=>[r.range.at(0),r.range.at(1)];return a.map(({node:r},o)=>t.replaceTextRange(n(r),s.slice(...n(e[o].node))))},N=(t={},s)=>Object.assign(s,t);const T="sort-interfaces",z=E({name:T,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedInterfacePropertiesOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[{type:"object",properties:{type:{enum:[d.natural,d["line-length"]]},order:{enum:[c.asc,c.desc]}},additionalProperties:!1}]},defaultOptions:[{type:d.natural,order:c.asc}],create:t=>({TSInterfaceBody:s=>{let a=N(t.options.at(0),{type:d.natural,order:c.asc}),l=s.body.map(e=>{let n="",r=0,o=i=>{r+=i},p=i=>{o(S(i.key.range))},g=i=>{let{length:f}="[]";o(i.parameters.reduce((h,{range:A})=>h+S(A),f))},m=i=>{if(i.optional){let{length:f}="?";o(f)}},y=i=>{var h;let f=(h=i.typeAnnotation)==null?void 0:h.range;f&&o(S(f))},u=i=>{if(i.type===x.AST_NODE_TYPES.Identifier)({name:n}=i);else if(i.type===x.AST_NODE_TYPES.TSIndexSignature){let f=i.parameters.at(0);f&&u(f)}};return e.type===x.AST_NODE_TYPES.TSPropertySignature?(u(e.key),p(e),m(e),y(e)):e.type===x.AST_NODE_TYPES.TSIndexSignature&&(u(e),g(e),y(e)),{node:e,name:n,size:r}});for(let e=1;e<l.length;e++){let n=e-1,r=e,o=l.at(n),p=l.at(r);if(I(o,p,a)){let g=s.body[r];t.report({messageId:"unexpectedInterfacePropertiesOrder",data:{first:o.name,second:p.name},node:g,fix:m=>{let y=t.getSourceCode(),{text:u}=y;return O(m,u,l,a)}})}}}})}),b="sort-jsx-props",J=E({name:b,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedJSXPropsOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[{type:"object",properties:{type:{enum:[d.natural,d["line-length"]]},order:{enum:[c.asc,c.desc]}},additionalProperties:!1}]},defaultOptions:[{type:d.natural,order:c.asc}],create:t=>({JSXElement:s=>{let a=N(t.options.at(0),{type:d.natural,order:c.asc});s.openingElement.attributes.reduce((e,n)=>(n.type==="JSXAttribute"?e.at(-1).push(n):e.push([]),e),[[]]).forEach(e=>{let n=e.map(r=>({name:r.name.type===x.AST_NODE_TYPES.JSXNamespacedName?`${r.name.namespace.name}:${r.name.name.name}`:r.name.name,size:S(r.range),node:r}));for(let r=1;r<n.length;r++){let o=r-1,p=r,g=n.at(o),m=n.at(p);I(g,m,a)&&t.report({messageId:"unexpectedJSXPropsOrder",data:{first:g.name,second:m.name},node:m.node,fix:y=>{let u=t.getSourceCode(),{text:i}=u;return O(y,i,n,a)}})}})}})}),P="sort-named-imports",$=E({name:P,meta:{type:"suggestion",docs:{description:"Enforce sorted interface properties",recommended:!1},messages:{unexpectedNamedImportsOrder:'Expected "{{second}}" to come before "{{first}}"'},fixable:"code",schema:[{type:"object",properties:{type:{enum:[d.natural,d["line-length"]]},order:{enum:[c.asc,c.desc]}},additionalProperties:!1}]},defaultOptions:[{type:d.natural,order:c.asc}],create:t=>({ImportDeclaration:s=>{let a=N(t.options.at(0),{type:d.natural,order:c.asc});if(s.specifiers.length>1){let l=s.specifiers.map(e=>{let{range:n,local:{name:r}}=e;return{size:S(n),node:e,name:r}});for(let e=1;e<l.length;e++){let n=e-1,r=e,o=l.at(n),p=l.at(r);if(I(o,p,a)){let g=s.specifiers[r];t.report({messageId:"unexpectedNamedImportsOrder",data:{first:o.name,second:p.name},node:g,fix:m=>{let y=t.getSourceCode(),{text:u}=y;return O(m,u,l,a)}})}}}}})});let _=t=>{let s={[T]:["error"],[b]:["error"],[P]:["error"]};return Object.fromEntries(Object.entries(s).map(([a,[l,e]])=>[a,[l,Object.assign(e,t)]]))};const v={name:C,rules:{[T]:z,[b]:J,[P]:$},configs:{"recommended-natural":_({type:"natural",order:"asc"}),"recommended-line-length":_({type:"line-length",order:"desc"})}};module.exports=v;
package/dist/index.mjs CHANGED
@@ -1,25 +1,22 @@
1
- import { AST_NODE_TYPES as g } from "@typescript-eslint/types";
2
- import { ESLintUtils as O } from "@typescript-eslint/utils";
3
- const E = "eslint-plugin-perfectionist", R = "azat-io/eslint-plugin-perfectionist";
4
- let I = O.RuleCreator(
5
- (a) => `https://github.com/${R}/blob/main/docs/rules/${a}.md`
6
- ), u = (a) => {
7
- let [i, n] = a;
8
- return n - i;
9
- }, S = (a, i, n) => {
10
- let e = [...n].sort((t, r) => r.size - t.size), s = (t) => [
11
- t.range.at(0),
12
- t.range.at(1)
13
- ];
14
- return n.map(
15
- ({ node: t }, r) => a.replaceTextRange(
16
- s(t),
17
- i.slice(...s(e[r].node))
18
- )
19
- );
1
+ import { AST_NODE_TYPES as y } from "@typescript-eslint/types";
2
+ import { ESLintUtils as C } from "@typescript-eslint/utils";
3
+ import T from "natural-compare-lite";
4
+ const z = "eslint-plugin-perfectionist", J = "azat-io/eslint-plugin-perfectionist";
5
+ let O = C.RuleCreator(
6
+ (t) => `https://github.com/${J}/blob/main/docs/rules/${t}.md`
7
+ ), h = (t) => {
8
+ let [s, a] = t;
9
+ return a - s;
20
10
  };
21
- const h = "sort-interfaces", T = I({
22
- name: h,
11
+ var d = /* @__PURE__ */ ((t) => (t.natural = "natural", t["line-length"] = "line-length", t))(d || {}), c = /* @__PURE__ */ ((t) => (t.asc = "asc", t.desc = "desc", t))(c || {});
12
+ let S = (t, s, a) => (a.order === "asc" ? 1 : -1) * (a.type === d.natural ? T(t.name, s.name) : t.size - s.size) > 0, b = (t, s, a, l) => {
13
+ let e = [...a].sort((r, o) => Number(S(r, o, l)) || -1), n = (r) => [r.range.at(0), r.range.at(1)];
14
+ return a.map(
15
+ ({ node: r }, o) => t.replaceTextRange(n(r), s.slice(...n(e[o].node)))
16
+ );
17
+ }, N = (t = {}, s) => Object.assign(s, t);
18
+ const E = "sort-interfaces", $ = O({
19
+ name: E,
23
20
  meta: {
24
21
  type: "suggestion",
25
22
  docs: {
@@ -30,64 +27,85 @@ const h = "sort-interfaces", T = I({
30
27
  unexpectedInterfacePropertiesOrder: 'Expected "{{second}}" to come before "{{first}}"'
31
28
  },
32
29
  fixable: "code",
33
- schema: []
30
+ schema: [
31
+ {
32
+ type: "object",
33
+ properties: {
34
+ type: {
35
+ enum: [d.natural, d["line-length"]]
36
+ },
37
+ order: {
38
+ enum: [c.asc, c.desc]
39
+ }
40
+ },
41
+ additionalProperties: !1
42
+ }
43
+ ]
34
44
  },
35
- defaultOptions: [],
36
- create: (a) => ({
37
- TSInterfaceBody: (i) => {
38
- let n = i.body.map((e) => {
39
- let s = "", t = 0, r = (o) => {
40
- t += o;
41
- }, d = (o) => {
42
- r(u(o.key.range));
43
- }, f = (o) => {
44
- let { length: p } = "[]";
45
- r(o.parameters.reduce((x, { range: N }) => x + u(N), p));
46
- }, c = (o) => {
47
- if (o.optional) {
48
- let { length: p } = "?";
49
- r(p);
45
+ defaultOptions: [
46
+ {
47
+ type: d.natural,
48
+ order: c.asc
49
+ }
50
+ ],
51
+ create: (t) => ({
52
+ TSInterfaceBody: (s) => {
53
+ let a = N(t.options.at(0), {
54
+ type: d.natural,
55
+ order: c.asc
56
+ }), l = s.body.map((e) => {
57
+ let n = "", r = 0, o = (i) => {
58
+ r += i;
59
+ }, p = (i) => {
60
+ o(h(i.key.range));
61
+ }, g = (i) => {
62
+ let { length: u } = "[]";
63
+ o(i.parameters.reduce((I, { range: A }) => I + h(A), u));
64
+ }, m = (i) => {
65
+ if (i.optional) {
66
+ let { length: u } = "?";
67
+ o(u);
50
68
  }
51
- }, m = (o) => {
52
- var x;
53
- let p = (x = o.typeAnnotation) == null ? void 0 : x.range;
54
- p && r(u(p));
55
- }, l = (o) => {
56
- if (o.type === g.Identifier)
57
- ({ name: s } = o);
58
- else if (o.type === g.TSIndexSignature) {
59
- let p = o.parameters.at(0);
60
- p && l(p);
69
+ }, x = (i) => {
70
+ var I;
71
+ let u = (I = i.typeAnnotation) == null ? void 0 : I.range;
72
+ u && o(h(u));
73
+ }, f = (i) => {
74
+ if (i.type === y.Identifier)
75
+ ({ name: n } = i);
76
+ else if (i.type === y.TSIndexSignature) {
77
+ let u = i.parameters.at(0);
78
+ u && f(u);
61
79
  }
62
80
  };
63
- return e.type === g.TSPropertySignature ? (l(e.key), d(e), c(e), m(e)) : e.type === g.TSIndexSignature && (l(e), f(e), m(e)), {
81
+ return e.type === y.TSPropertySignature ? (f(e.key), p(e), m(e), x(e)) : e.type === y.TSIndexSignature && (f(e), g(e), x(e)), {
64
82
  node: e,
65
- name: s,
66
- size: t
83
+ name: n,
84
+ size: r
67
85
  };
68
86
  });
69
- for (let e = 1; e < n.length; e++) {
70
- let s = e - 1, t = e, r = n.at(s), d = n.at(t);
71
- if (r.size < d.size) {
72
- let f = i.body[t];
73
- a.report({
87
+ for (let e = 1; e < l.length; e++) {
88
+ let n = e - 1, r = e, o = l.at(n), p = l.at(r);
89
+ if (S(o, p, a)) {
90
+ let g = s.body[r];
91
+ t.report({
74
92
  messageId: "unexpectedInterfacePropertiesOrder",
75
93
  data: {
76
- first: r.name,
77
- second: d.name
94
+ first: o.name,
95
+ second: p.name
78
96
  },
79
- node: f,
80
- fix: (c) => {
81
- let m = a.getSourceCode(), { text: l } = m;
82
- return S(c, l, n);
97
+ node: g,
98
+ fix: (m) => {
99
+ let x = t.getSourceCode(), { text: f } = x;
100
+ return b(m, f, l, a);
83
101
  }
84
102
  });
85
103
  }
86
104
  }
87
105
  }
88
106
  })
89
- }), y = "sort-jsx-props", A = I({
90
- name: y,
107
+ }), R = "sort-jsx-props", v = O({
108
+ name: R,
91
109
  meta: {
92
110
  type: "suggestion",
93
111
  docs: {
@@ -98,40 +116,62 @@ const h = "sort-interfaces", T = I({
98
116
  unexpectedJSXPropsOrder: 'Expected "{{second}}" to come before "{{first}}"'
99
117
  },
100
118
  fixable: "code",
101
- schema: []
119
+ schema: [
120
+ {
121
+ type: "object",
122
+ properties: {
123
+ type: {
124
+ enum: [d.natural, d["line-length"]]
125
+ },
126
+ order: {
127
+ enum: [c.asc, c.desc]
128
+ }
129
+ },
130
+ additionalProperties: !1
131
+ }
132
+ ]
102
133
  },
103
- defaultOptions: [],
104
- create: (a) => ({
105
- JSXElement: (i) => {
106
- i.openingElement.attributes.reduce(
107
- (e, s) => (s.type === "JSXAttribute" ? e.at(-1).push(s) : e.push([]), e),
134
+ defaultOptions: [
135
+ {
136
+ type: d.natural,
137
+ order: c.asc
138
+ }
139
+ ],
140
+ create: (t) => ({
141
+ JSXElement: (s) => {
142
+ let a = N(t.options.at(0), {
143
+ type: d.natural,
144
+ order: c.asc
145
+ });
146
+ s.openingElement.attributes.reduce(
147
+ (e, n) => (n.type === "JSXAttribute" ? e.at(-1).push(n) : e.push([]), e),
108
148
  [[]]
109
149
  ).forEach((e) => {
110
- let s = e.map((t) => ({
111
- name: t.name.type === g.JSXNamespacedName ? `${t.name.namespace.name}:${t.name.name.name}` : t.name.name,
112
- size: u(t.range),
113
- node: t
150
+ let n = e.map((r) => ({
151
+ name: r.name.type === y.JSXNamespacedName ? `${r.name.namespace.name}:${r.name.name.name}` : r.name.name,
152
+ size: h(r.range),
153
+ node: r
114
154
  }));
115
- for (let t = 1; t < s.length; t++) {
116
- let r = t - 1, d = t, f = s.at(r), c = s.at(d);
117
- f.size < c.size && a.report({
155
+ for (let r = 1; r < n.length; r++) {
156
+ let o = r - 1, p = r, g = n.at(o), m = n.at(p);
157
+ S(g, m, a) && t.report({
118
158
  messageId: "unexpectedJSXPropsOrder",
119
159
  data: {
120
- first: f.name,
121
- second: c.name
160
+ first: g.name,
161
+ second: m.name
122
162
  },
123
- node: c.node,
124
- fix: (m) => {
125
- let l = a.getSourceCode(), { text: o } = l;
126
- return S(m, o, s);
163
+ node: m.node,
164
+ fix: (x) => {
165
+ let f = t.getSourceCode(), { text: i } = f;
166
+ return b(x, i, n, a);
127
167
  }
128
168
  });
129
169
  }
130
170
  });
131
171
  }
132
172
  })
133
- }), z = "sort-named-imports", b = I({
134
- name: z,
173
+ }), P = "sort-named-imports", X = O({
174
+ name: P,
135
175
  meta: {
136
176
  type: "suggestion",
137
177
  docs: {
@@ -142,37 +182,59 @@ const h = "sort-interfaces", T = I({
142
182
  unexpectedNamedImportsOrder: 'Expected "{{second}}" to come before "{{first}}"'
143
183
  },
144
184
  fixable: "code",
145
- schema: []
185
+ schema: [
186
+ {
187
+ type: "object",
188
+ properties: {
189
+ type: {
190
+ enum: [d.natural, d["line-length"]]
191
+ },
192
+ order: {
193
+ enum: [c.asc, c.desc]
194
+ }
195
+ },
196
+ additionalProperties: !1
197
+ }
198
+ ]
146
199
  },
147
- defaultOptions: [],
148
- create: (a) => ({
149
- ImportDeclaration: (i) => {
150
- if (i.specifiers.length > 1) {
151
- let n = i.specifiers.map((e) => {
200
+ defaultOptions: [
201
+ {
202
+ type: d.natural,
203
+ order: c.asc
204
+ }
205
+ ],
206
+ create: (t) => ({
207
+ ImportDeclaration: (s) => {
208
+ let a = N(t.options.at(0), {
209
+ type: d.natural,
210
+ order: c.asc
211
+ });
212
+ if (s.specifiers.length > 1) {
213
+ let l = s.specifiers.map((e) => {
152
214
  let {
153
- range: s,
154
- local: { name: t }
215
+ range: n,
216
+ local: { name: r }
155
217
  } = e;
156
218
  return {
157
- size: u(s),
219
+ size: h(n),
158
220
  node: e,
159
- name: t
221
+ name: r
160
222
  };
161
223
  });
162
- for (let e = 1; e < n.length; e++) {
163
- let s = e - 1, t = e, r = n.at(s), d = n.at(t);
164
- if (r.size < d.size) {
165
- let f = i.specifiers[t];
166
- a.report({
224
+ for (let e = 1; e < l.length; e++) {
225
+ let n = e - 1, r = e, o = l.at(n), p = l.at(r);
226
+ if (S(o, p, a)) {
227
+ let g = s.specifiers[r];
228
+ t.report({
167
229
  messageId: "unexpectedNamedImportsOrder",
168
230
  data: {
169
- first: r.name,
170
- second: d.name
231
+ first: o.name,
232
+ second: p.name
171
233
  },
172
- node: f,
173
- fix: (c) => {
174
- let m = a.getSourceCode(), { text: l } = m;
175
- return S(c, l, n);
234
+ node: g,
235
+ fix: (m) => {
236
+ let x = t.getSourceCode(), { text: f } = x;
237
+ return b(m, f, l, a);
176
238
  }
177
239
  });
178
240
  }
@@ -180,14 +242,32 @@ const h = "sort-interfaces", T = I({
180
242
  }
181
243
  }
182
244
  })
183
- }), J = {
184
- name: E,
245
+ });
246
+ let j = (t) => {
247
+ let s = {
248
+ [E]: ["error"],
249
+ [R]: ["error"],
250
+ [P]: ["error"]
251
+ };
252
+ return Object.fromEntries(
253
+ Object.entries(s).map(([a, [l, e]]) => [
254
+ a,
255
+ [l, Object.assign(e, t)]
256
+ ])
257
+ );
258
+ };
259
+ const D = {
260
+ name: z,
185
261
  rules: {
186
- [h]: T,
187
- [y]: A,
188
- [z]: b
262
+ [E]: $,
263
+ [R]: v,
264
+ [P]: X
265
+ },
266
+ configs: {
267
+ "recommended-natural": j({ type: "natural", order: "asc" }),
268
+ "recommended-line-length": j({ type: "line-length", order: "desc" })
189
269
  }
190
270
  };
191
271
  export {
192
- J as default
272
+ D as default
193
273
  };
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "eslint-plugin-perfectionist",
3
3
  "description": "ESLint plugin for code formatting in perfectionist style",
4
- "version": "0.2.0",
4
+ "version": "0.3.0",
5
+ "homepage": "https://eslint-plugin-perfectionist.azat.io",
5
6
  "repository": "azat-io/eslint-plugin-perfectionist",
6
7
  "author": "Azat S. <to@azat.io>",
7
8
  "license": "MIT",
@@ -18,8 +19,8 @@
18
19
  ],
19
20
  "exports": {
20
21
  ".": {
21
- "require": "./dist/index.cjs.js",
22
- "import": "./dist/index.es.js"
22
+ "require": "./dist/index.js",
23
+ "import": "./dist/index.mjs"
23
24
  },
24
25
  "./package.json": "./package.json"
25
26
  },
@@ -27,7 +28,8 @@
27
28
  "eslint": "^8.39.0"
28
29
  },
29
30
  "dependencies": {
30
- "@typescript-eslint/types": "^5.59.2",
31
- "@typescript-eslint/utils": "^5.59.2"
31
+ "@typescript-eslint/types": "^5.59.6",
32
+ "@typescript-eslint/utils": "^5.59.6",
33
+ "natural-compare-lite": "^1.4.0"
32
34
  }
33
35
  }
package/readme.md CHANGED
@@ -27,6 +27,7 @@ npm install --save-dev eslint-plugin-perfectionist
27
27
  | [sort-interfaces](https://eslint-plugin-perfectionist.azat.io/rules/sort-interfaces) | Enforce sorted interface properties | ✅ | 🔧 |
28
28
  | [sort-jsx-props](https://eslint-plugin-perfectionist.azat.io/rules/sort-jsx-props) | Enforce sorted JSX props | ✅ | 🔧 |
29
29
  | [sort-named-imports](https://eslint-plugin-perfectionist.azat.io/rules/sort-named-imports) | Enforce sorted named imports | ✅ | 🔧 |
30
+ | [sort-union-types](https://eslint-plugin-perfectionist.azat.io/rules/sort-union-types) | Enforce sorted union types | ✅ | 🔧 |
30
31
 
31
32
  ## See also
32
33