eslint-plugin-perfectionist
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -1,1 +0,1 @@ | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("node:module");const r={rules:e.configs["recommended-alphabetical"].rules,plugins:{perfectionist:e}};module.exports=r; | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("@typescript-eslint/types");require("node:module");const r={rules:e.configs["recommended-alphabetical"].rules,plugins:{perfectionist:e}};module.exports=r; |
@@ -1,1 +0,1 @@ | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("node:module");const r={rules:e.configs["recommended-line-length"].rules,plugins:{perfectionist:e}};module.exports=r; | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("@typescript-eslint/types");require("node:module");const r={rules:e.configs["recommended-line-length"].rules,plugins:{perfectionist:e}};module.exports=r; |
@@ -1,1 +0,1 @@ | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("node:module");const r={rules:e.configs["recommended-natural"].rules,plugins:{perfectionist:e}};module.exports=r; | ||
"use strict";const e=require("../index.js");require("node:path");require("@typescript-eslint/utils");require("minimatch");require("natural-compare-lite");require("@typescript-eslint/types");require("node:module");const r={rules:e.configs["recommended-natural"].rules,plugins:{perfectionist:e}};module.exports=r; |
@@ -1,3 +0,3 @@ | ||
"use strict";const q=require("node:path"),W=require("@typescript-eslint/utils"),D=require("minimatch"),de=require("natural-compare-lite"),ce=require("node:module");let k=W.ESLintUtils.RuleCreator(e=>`https://eslint-plugin-perfectionist.azat.io/rules/${e}`),h=(e,i)=>{for(let s=0,l=e.length;s<l;s++){let r=e[s];if(i.group===r||Array.isArray(r)&&typeof i.group=="string"&&r.includes(i.group))return s}return e.length},I=e=>{let[i,s]=e;return s-i},O=e=>e>0;var u=(e=>(e.alphabetical="alphabetical",e["line-length"]="line-length",e.natural="natural",e))(u||{}),g=(e=>(e.desc="desc",e.asc="asc",e))(g||{}),T=(e=>(e["values-first"]="values-first",e["types-first"]="types-first",e.mixed="mixed",e))(T||{});let G=e=>{let i,s=r=>{!i&&e.flat().includes(r)&&(i=r)};return{getGroup:()=>i??"unknown",setCustomGroups:(r,t)=>{if(r)for(let[a,n]of Object.entries(r))Array.isArray(n)&&n.some(o=>D.minimatch(t,o,{nocomment:!0}))&&s(a),typeof n=="string"&&D.minimatch(t,n,{nocomment:!0})&&s(a)},defineGroup:s}},S=(e,i,s)=>{var a,n;if((a=i.dependencies)!=null&&a.includes(e.name))return-1;if((n=e.dependencies)!=null&&n.includes(i.name))return 1;let l=s.order==="asc"?1:-1,r,t=o=>s["ignore-case"]?o.toLowerCase():o;return s.type===u.alphabetical?r=(o,p)=>t(o.name).localeCompare(t(p.name)):s.type===u.natural?r=(o,p)=>de(t(o.name),t(p.name)):r=(o,p)=>{let f=o.size,y=p.size,d=s["max-line-length"];if(d){let c=(m,x)=>m>d&&x.hasMultipleImportDeclarations;c(f,o)&&(f=o.name.length+10),c(y,p)&&(y=p.name.length+10)}return f-y},l*r(e,i)},v=(e,i)=>[...e].sort((s,l)=>S(s,l,i)),fe=(e,i)=>{let s=i.getTokenAfter(e,{filter:({value:l,type:r})=>!(r==="Punctuator"&&[",",";"].includes(l)),includeComments:!0});return((s==null?void 0:s.type)==="Block"||(s==null?void 0:s.type)==="Line")&&e.loc.end.line===s.loc.end.line?s:null},J=(e,i)=>Array.isArray(e)&&e.some(s=>D.minimatch(i.trim(),s,{nocomment:!0}))||typeof e=="string"&&D.minimatch(i.trim(),e,{nocomment:!0})||e===!0,V=(e,i)=>{let[s,l]=i.getTokensBefore(e,{filter:({value:r,type:t})=>!(t==="Punctuator"&&[",",";"].includes(r)),includeComments:!0,count:2});return((l==null?void 0:l.type)==="Block"||(l==null?void 0:l.type)==="Line")&&e.loc.start.line-l.loc.end.line<=1&&(s==null?void 0:s.loc.end.line)!==l.loc.start.line?l:null},M=(e,i,s)=>{var n;let l=e.range.at(0),r=e.range.at(1),t=i.text.slice(l,r);if(W.ASTUtils.isParenthesized(e,i)){let o=i.getTokenBefore(e,W.ASTUtils.isOpeningParenToken),p=i.getTokenAfter(e,W.ASTUtils.isClosingParenToken);l=o.range.at(0),r=p.range.at(1)}let a=V(e,i);if(t.endsWith(";")||t.endsWith(",")){let o=i.getTokensAfter(e,{includeComments:!0,count:2});e.loc.start.line===((n=o.at(1))==null?void 0:n.loc.start.line)&&(r-=1)}return a&&!J((s==null?void 0:s.partitionComment)??!1,a.value)&&(l=a.range.at(0)),[l,r]},L=(e,i,s,l,r)=>{var n,o;let t=[],a=((n=i.at(0))==null?void 0:n.node.loc.start.line)===((o=i.at(-1))==null?void 0:o.node.loc.end.line);for(let p=0,f=i.length;p<f;p++){let{node:y}=i.at(p);t.push(e.replaceTextRange(M(y,l,r),l.text.slice(...M(s.at(p).node,l,r))));let d=fe(s.at(p).node,l);if(d&&!a){let m=[l.getTokenBefore(d).range.at(1),d.range.at(1)];t.push(e.replaceTextRange(m,""));let x=l.getTokenAfter(y);t.push(e.insertTextAfter((x==null?void 0:x.loc.end.line)===y.loc.end.line?x:y,l.text.slice(...m)))}}return t},j=(e={},i)=>Object.assign(i,e),P=(e,i)=>{if(e.length>1)for(let s=1;s<e.length;s++){let l=e.at(s-1),r=e.at(s);l&&r&&i(l,r,s-1)}};const X="sort-svelte-attributes",ge=k({name:X,meta:{type:"suggestion",docs:{description:"enforce sorted Svelte attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedSvelteAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>q.extname(e.filename)!==".svelte"?{}:{SvelteStartTag:i=>{if(i.attributes.length>1){let s=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),l=i.attributes.reduce((r,t)=>{if(t.type==="SvelteSpreadAttribute")return r.push([]),r;let a,{getGroup:n,defineGroup:o,setCustomGroups:p}=G(s.groups);return t.key.type==="SvelteSpecialDirectiveKey"?a=e.sourceCode.text.slice(...t.key.range):typeof t.key.name=="string"?{name:a}=t.key:a=e.sourceCode.text.slice(...t.key.range),p(s["custom-groups"],a),t.type==="SvelteShorthandAttribute"&&(o("svelte-shorthand"),o("shorthand")),(!("value"in t)||Array.isArray(t.value)&&!t.value.at(0))&&o("shorthand"),t.loc.start.line!==t.loc.end.line&&o("multiline"),r.at(-1).push({size:I(t.range),node:t,group:n(),name:a}),r},[[]]);for(let r of l)P(r,(t,a)=>{let n=h(s.groups,t),o=h(s.groups,a);(n>o||n===o&&O(S(t,a,s)))&&e.report({messageId:"unexpectedSvelteAttributesOrder",data:{left:t.name,right:a.name},node:a.node,fix:p=>{let f={};for(let d of r){let c=h(s.groups,d);c in f?f[c]=v([...f[c],d],s):f[c]=[d]}let y=[];for(let d of Object.keys(f).sort((c,m)=>Number(c)-Number(m)))y.push(...v(f[d],s));return L(p,r,y,e.sourceCode)}})})}}}}),H="sort-astro-attributes",ye=k({name:H,meta:{type:"suggestion",docs:{description:"enforce sorted Astro attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedAstroAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>q.extname(e.filename)!==".astro"?{}:{JSXElement:i=>{let{attributes:s}=i.openingElement;if(s.length>1){let l=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),r=s.reduce((t,a)=>{if(a.type==="JSXSpreadAttribute")return t.push([]),t;let n=typeof a.name.name=="string"?a.name.name:e.sourceCode.text.slice(...a.name.range),{getGroup:o,defineGroup:p,setCustomGroups:f}=G(l.groups);return f(l["custom-groups"],n),a.type==="AstroShorthandAttribute"&&(p("astro-shorthand"),p("shorthand")),a.value===null&&p("shorthand"),a.loc.start.line!==a.loc.end.line&&p("multiline"),t.at(-1).push({size:I(a.range),node:a,group:o(),name:n}),t},[[]]);for(let t of r)P(t,(a,n)=>{let o=h(l.groups,a),p=h(l.groups,n);(o>p||o===p&&O(S(a,n,l)))&&e.report({messageId:"unexpectedAstroAttributesOrder",data:{left:a.name,right:n.name},node:n.node,fix:f=>{let y={};for(let c of t){let m=h(l.groups,c);m in y?y[m]=v([...y[m],c],l):y[m]=[c]}let d=[];for(let c of Object.keys(y).sort((m,x)=>Number(m)-Number(x)))d.push(...v(y[c],l));return L(f,t,d,e.sourceCode)}})})}}}});let A=e=>e.replaceAll(/\s\s+/g," ").trim();const Q="sort-array-includes",me=k({name:Q,meta:{type:"suggestion",docs:{description:"enforce sorted arrays before include method"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"spread-last":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedArrayIncludesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({MemberExpression:i=>{if((i.object.type==="ArrayExpression"||i.object.type==="NewExpression")&&i.property.type==="Identifier"&&i.property.name==="includes"){let s=i.object.type==="ArrayExpression"?i.object.elements:i.object.arguments;if(s.length>1){let l=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,"spread-last":!1}),r=s.reduce((t,a)=>(a!==null&&t.at(0).push({name:a.type==="Literal"?`${a.value}`:e.sourceCode.text.slice(...a.range),size:I(a.range),type:a.type,node:a}),t),[[],[]]).flat();P(r,(t,a)=>{let n;l["spread-last"]&&t.node.type==="Literal"&&a.node.type==="SpreadElement"?n=!1:l["spread-last"]&&t.node.type==="SpreadElement"&&a.node.type==="Literal"?n=!0:n=O(S(t,a,l)),n&&e.report({messageId:"unexpectedArrayIncludesOrder",data:{left:A(t.name),right:A(a.name)},node:a.node,fix:o=>{let p=v(r,l);if(l["spread-last"])for(let f=0,y=p.length;f<y;f++)p.at(f).node.type==="SpreadElement"&&p.push(p.splice(f,1).at(0));return L(o,r,p,e.sourceCode)}})})}}}})}),Y="sort-vue-attributes",he=k({name:Y,meta:{type:"suggestion",docs:{description:"enforce sorted Vue attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]}},additionalProperties:!1}],messages:{unexpectedVueAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>{if(q.extname(e.filename)!==".vue")return{};if(!("defineTemplateBodyVisitor"in e.sourceCode.parserServices))return{};let{defineTemplateBodyVisitor:i}=e.sourceCode.parserServices;return i({VStartTag:s=>{if(s.attributes.length>1){let l=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),r=s.attributes.reduce((t,a)=>{if(a.key.type==="VDirectiveKey"&&a.key.name.rawName==="bind")return t.push([]),t;let n,{getGroup:o,defineGroup:p,setCustomGroups:f}=G(l.groups);return typeof a.key.name=="string"&&a.key.type!=="VDirectiveKey"?n=a.key.rawName:n=e.sourceCode.text.slice(...a.key.range),f(l["custom-groups"],n),a.value===null&&p("shorthand"),a.loc.start.line!==a.loc.end.line&&p("multiline"),t.at(-1).push({size:I(a.range),node:a,group:o(),name:n}),t},[[]]);for(let t of r)P(t,(a,n)=>{let o=h(l.groups,a),p=h(l.groups,n);(o>p||o===p&&O(S(a,n,l)))&&e.report({messageId:"unexpectedVueAttributesOrder",data:{left:a.name,right:n.name},node:n.node,fix:f=>{let y={};for(let c of t){let m=h(l.groups,c);m in y?y[m]=v([...y[m],c],l):y[m]=[c]}let d=[];for(let c of Object.keys(y).sort((m,x)=>Number(m)-Number(x)))d.push(...v(y[c],l));return L(f,t,d,e.sourceCode)}})})}}})}}),Z="sort-named-exports",be=k({name:Z,meta:{type:"suggestion",docs:{description:"enforce sorted named exports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"group-kind":{enum:[T.mixed,T["values-first"],T["types-first"]],default:T.mixed,type:"string"}},additionalProperties:!1}],messages:{unexpectedNamedExportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({ExportNamedDeclaration:i=>{if(i.specifiers.length>1){let s=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:g.asc,"group-kind":T.mixed}),l=i.specifiers.map(a=>({size:I(a.range),name:a.local.name,node:a,group:a.exportKind})),r=s["group-kind"]!==T.mixed,t=s["group-kind"]===T["values-first"]?["value","type"]:["type","value"];P(l,(a,n)=>{let o=h(t,a),p=h(t,n);if(r&&o>p||(!r||o===p)&&O(S(a,n,s))){let f=r?t.map(y=>l.filter(d=>d.group===y)).map(y=>v(y,s)).flat():v(l,s);e.report({messageId:"unexpectedNamedExportsOrder",data:{left:a.name,right:n.name},node:n.node,fix:y=>L(y,l,f,e.sourceCode)})}})}}})}),F="sort-named-imports",xe=k({name:F,meta:{type:"suggestion",docs:{description:"enforce sorted named imports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-alias":{type:"boolean",default:!1},"group-kind":{enum:[T.mixed,T["values-first"],T["types-first"]],default:T.mixed,type:"string"}},additionalProperties:!1}],messages:{unexpectedNamedImportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({ImportDeclaration:i=>{let s=i.specifiers.filter(({type:l})=>l==="ImportSpecifier");if(s.length>1){let l=j(e.options.at(0),{type:u.alphabetical,"ignore-alias":!0,"ignore-case":!1,order:g.asc,"group-kind":T.mixed}),r=s.map(n=>{let o,{name:p}=n.local;return n.type==="ImportSpecifier"&&(l["ignore-alias"]&&({name:p}=n.imported),o=n.importKind),{size:I(n.range),node:n,name:p,group:o}}),t=l["group-kind"]!==T.mixed,a=l["group-kind"]===T["values-first"]?["value","type"]:["type","value"];P(r,(n,o)=>{let p=h(a,n),f=h(a,o);if(t&&p>f||(!t||p===f)&&O(S(n,o,l))){let y=t?a.map(d=>r.filter(c=>c.group===d)).map(d=>v(d,l)).flat():v(r,l);e.report({messageId:"unexpectedNamedImportsOrder",data:{left:n.name,right:o.name},node:o.node,fix:d=>L(d,r,y,e.sourceCode)})}})}}})});let z=(e,i,s)=>e.lines.slice(i.node.loc.end.line,s.node.loc.start.line-1).filter(r=>!r.trim().length).length;const ee="sort-object-types",Ee=k({name:ee,meta:{type:"suggestion",docs:{description:"enforce sorted object types"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]},"partition-by-new-line":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedObjectTypesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({TSTypeLiteral:i=>{if(i.members.length>1){let s=j(e.options.at(0),{"partition-by-new-line":!1,type:u.alphabetical,"ignore-case":!1,order:g.asc,"custom-groups":{},groups:[]}),l=i.members.reduce((r,t)=>{var C,b,N,E;let a,n=e.sourceCode.text.slice(t.range.at(0),t.range.at(1)),o=(C=r.at(-1))==null?void 0:C.at(-1),{getGroup:p,defineGroup:f,setCustomGroups:y}=G(s.groups),d=w=>w.replace(/(,|;)$/,"");if(t.type==="TSPropertySignature")t.key.type==="Identifier"?{name:a}=t.key:t.key.type==="Literal"?a=`${t.key.value}`:a=e.sourceCode.text.slice(t.range.at(0),(b=t.typeAnnotation)==null?void 0:b.range.at(0));else if(t.type==="TSIndexSignature"){let w=((N=t.typeAnnotation)==null?void 0:N.range.at(0))??t.range.at(1);a=d(e.sourceCode.text.slice(t.range.at(0),w))}else a=d(e.sourceCode.text.slice(t.range.at(0),t.range.at(1)));y(s["custom-groups"],a),t.loc.start.line!==t.loc.end.line&&f("multiline");let m=n.endsWith(";")||n.endsWith(",")?1:0,x={size:I(t.range)-m,node:t,name:a};return s["partition-by-new-line"]&&o&&z(e.sourceCode,o,x)&&r.push([]),(E=r.at(-1))==null||E.push({...x,group:p()}),r},[[]]);for(let r of l)P(r,(t,a)=>{let n=h(s.groups,t),o=h(s.groups,a);(n>o||n===o&&O(S(t,a,s)))&&e.report({messageId:"unexpectedObjectTypesOrder",data:{left:A(t.name),right:A(a.name)},node:a.node,fix:p=>{let f={};for(let d of r){let c=h(s.groups,d);c in f?f[c]=v([...f[c],d],s):f[c]=[d]}let y=[];for(let d of Object.keys(f).sort((c,m)=>Number(c)-Number(m)))y.push(...v(f[d],s));return L(p,r,y,e.sourceCode)}})})}}})}),te="sort-union-types",Ne=k({name:te,meta:{type:"suggestion",docs:{description:"enforce sorted union types"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"nullable-last":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedUnionTypesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({TSUnionType:i=>{let s=j(e.options.at(0),{type:u.alphabetical,"nullable-last":!1,"ignore-case":!1,order:g.asc}),l=i.types.map(r=>({group:r.type==="TSNullKeyword"||r.type==="TSUndefinedKeyword"?"nullable":"unknown",name:e.sourceCode.text.slice(...r.range),size:I(r.range),node:r}));P(l,(r,t)=>{let a=O(S(r,t,s));s["nullable-last"]&&(r.group==="nullable"&&t.group==="unknown"?a=!0:r.group==="unknown"&&t.group==="nullable"&&(a=!1)),a&&e.report({messageId:"unexpectedUnionTypesOrder",data:{left:A(r.name),right:A(t.name)},node:t.node,fix:n=>{let o=[];if(s["nullable-last"]){let p=[],f=l.filter(y=>y.group==="nullable"?(p.push(y),!1):!0);o=[...v(f,s),...v(p,s)]}else o=v(l,s);return L(n,l,o,e.sourceCode)}})})}})}),re="sort-interfaces",Ce=k({name:re,meta:{type:"suggestion",docs:{description:"enforce sorted interface properties"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-pattern":{items:{type:"string"},type:"array"},groups:{type:"array",default:[]},"partition-by-new-line":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedInterfacePropertiesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({TSInterfaceDeclaration:i=>{if(i.body.body.length>1){let s=j(e.options.at(0),{"partition-by-new-line":!1,type:u.alphabetical,"ignore-case":!1,order:g.asc,"ignore-pattern":[],"custom-groups":{},groups:[]});if(!s["ignore-pattern"].some(l=>D.minimatch(i.id.name,l,{nocomment:!0}))){let l=i.body.body.reduce((r,t)=>{var d,c,m,x;if(t.type==="TSCallSignatureDeclaration")return r.push([]),r;let a=(d=r.at(-1))==null?void 0:d.at(-1),n,{getGroup:o,defineGroup:p,setCustomGroups:f}=G(s.groups);if(t.type==="TSPropertySignature")if(t.key.type==="Identifier")({name:n}=t.key);else if(t.key.type==="Literal")n=`${t.key.value}`;else{let C=((c=t.typeAnnotation)==null?void 0:c.range.at(0))??t.range.at(1)-(t.optional?1:0);n=e.sourceCode.text.slice(t.range.at(0),C)}else if(t.type==="TSIndexSignature"){let C=((m=t.typeAnnotation)==null?void 0:m.range.at(0))??t.range.at(1);n=e.sourceCode.text.slice(t.range.at(0),C)}else{let C=((x=t.returnType)==null?void 0:x.range.at(0))??t.range.at(1);n=e.sourceCode.text.slice(t.range.at(0),C)}let y={size:I(t.range),node:t,name:n};return s["partition-by-new-line"]&&a&&z(e.sourceCode,a,y)&&r.push([]),f(s["custom-groups"],n),t.loc.start.line!==t.loc.end.line&&p("multiline"),r.at(-1).push({...y,group:o()}),r},[[]]);for(let r of l)P(r,(t,a)=>{let n=h(s.groups,t),o=h(s.groups,a);(n>o||n===o&&O(S(t,a,s)))&&e.report({messageId:"unexpectedInterfacePropertiesOrder",data:{left:A(t.name),right:A(a.name)},node:a.node,fix:p=>{let f={};for(let d of r){let c=h(s.groups,d);c in f?f[c]=v([...f[c],d],s):f[c]=[d]}let y=[];for(let d of Object.keys(f).sort((c,m)=>Number(c)-Number(m)))y.push(...v(f[d],s));return L(p,r,y,e.sourceCode)}})})}}}})}),se="sort-jsx-props",ve=k({name:se,meta:{type:"suggestion",docs:{description:"enforce sorted JSX props"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},groups:{type:"array"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedJSXPropsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>[".svelte",".astro",".vue"].includes(q.extname(e.filename))?{}:{JSXElement:i=>{if(i.openingElement.attributes.length>1){let s=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:g.asc,"custom-groups":{},groups:[]}),l=i.openingElement.attributes.reduce((r,t)=>{if(t.type==="JSXSpreadAttribute")return r.push([]),r;let a=t.name.type==="JSXNamespacedName"?`${t.name.namespace.name}:${t.name.name.name}`:t.name.name,{getGroup:n,defineGroup:o,setCustomGroups:p}=G(s.groups);p(s["custom-groups"],a),t.value===null&&o("shorthand"),t.loc.start.line!==t.loc.end.line&&o("multiline");let f={size:I(t.range),group:n(),node:t,name:a};return r.at(-1).push(f),r},[[]]);for(let r of l)P(r,(t,a)=>{let n=h(s.groups,t),o=h(s.groups,a);(n>o||n===o&&O(S(t,a,s)))&&e.report({messageId:"unexpectedJSXPropsOrder",data:{left:t.name,right:a.name},node:a.node,fix:p=>{let f={};for(let d of r){let c=h(s.groups,d);c in f?f[c]=v([...f[c],d],s):f[c]=[d]}let y=[];for(let d of Object.keys(f).sort((c,m)=>Number(c)-Number(m)))y.push(...v(f[d],s));return L(p,r,y,e.sourceCode)}})})}}}}),ae="sort-exports",we=k({name:ae,meta:{type:"suggestion",docs:{description:"enforce sorted exports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedExportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>{let i=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1}),s=[[]],l=r=>{r.type==="ExportAllDeclaration"&&r.exported===null?s.push([]):s.at(-1).push({size:I(r.range),name:r.source.value,node:r})};return{ExportAllDeclaration:l,ExportNamedDeclaration:r=>{r.source!==null&&l(r)},"Program:exit":()=>{for(let r of s)P(r,(t,a)=>{O(S(t,a,i))&&e.report({messageId:"unexpectedExportsOrder",data:{left:t.name,right:a.name},node:a.node,fix:n=>L(n,r,v(r,i),e.sourceCode)})})}}}}),oe="sort-imports",Se=k({name:oe,meta:{type:"suggestion",docs:{description:"enforce sorted imports"},fixable:"code",schema:[{id:"sort-imports",type:"object",properties:{"custom-groups":{type:"object",properties:{type:{type:"object"},value:{type:"object"}},additionalProperties:!1},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]},"internal-pattern":{items:{type:"string"},type:"array"},"newlines-between":{enum:["ignore","always","never"],default:"always",type:"string"},"max-line-length":{type:"integer",minimum:0,exclusiveMinimum:!0}},allOf:[{$ref:"#/definitions/max-line-length-requires-line-length-type"}],additionalProperties:!1,dependencies:{"max-line-length":["type"]},definitions:{"is-line-length":{properties:{type:{enum:[u["line-length"]],type:"string"}},required:["type"],type:"object"},"max-line-length-requires-line-length-type":{anyOf:[{not:{required:["max-line-length"],type:"object"},type:"object"},{$ref:"#/definitions/is-line-length"}]}}}],messages:{unexpectedImportsOrder:'Expected "{{right}}" to come before "{{left}}"',missedSpacingBetweenImports:'Missed spacing between "{{left}}" and "{{right}}" imports',extraSpacingBetweenImports:'Extra spacing between "{{left}}" and "{{right}}" imports'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>{let i=j(e.options.at(0),{"newlines-between":"always","custom-groups":{type:{},value:{}},"internal-pattern":["~/**"],type:u.alphabetical,order:g.asc,"ignore-case":!1,groups:[]}),s=!1;for(let o of i.groups)if(Array.isArray(o))for(let p of o)p==="unknown"&&(s=!0);else o==="unknown"&&(s=!0);s||(i.groups=[...i.groups,"unknown"]);let l=[],r=o=>o.type==="ImportDeclaration"&&o.specifiers.length===0,t=o=>{let p=E=>[".less",".scss",".sass",".styl",".pcss",".css",".sss"].some(w=>E.endsWith(w)),f=E=>["./index.d.js","./index.d.ts","./index.js","./index.ts","./index","./","."].includes(E),y=E=>E.indexOf("..")===0,d=E=>E.indexOf("./")===0,{getGroup:c,defineGroup:m,setCustomGroups:x}=G(i.groups),C=E=>i["internal-pattern"].length&&i["internal-pattern"].some(w=>D.minimatch(E.source.value,w,{nocomment:!0})),b=E=>{let w=["bun","bun:ffi","bun:jsc","bun:sqlite","bun:test","bun:wrap","detect-libc","undici","ws"];return ce.builtinModules.includes(E.startsWith("node:")?E.split("node:")[1]:E)||w.includes(E)},N=E=>!(E.startsWith(".")||E.startsWith("/"));return o.importKind==="type"&&(o.type==="ImportDeclaration"&&(x(i["custom-groups"].type,o.source.value),f(o.source.value)&&m("index-type"),d(o.source.value)&&m("sibling-type"),y(o.source.value)&&m("parent-type"),C(o)&&m("internal-type"),b(o.source.value)&&m("builtin-type"),N(o.source.value)&&m("external-type")),m("type")),o.type==="ImportDeclaration"&&(x(i["custom-groups"].value,o.source.value),r(o)&&p(o.source.value)&&m("side-effect-style"),r(o)&&m("side-effect"),p(o.source.value)&&m("style"),f(o.source.value)&&m("index"),d(o.source.value)&&m("sibling"),y(o.source.value)&&m("parent"),C(o)&&m("internal"),b(o.source.value)&&m("builtin"),N(o.source.value)&&m("external")),c()},a=o=>o.specifiers.length>1,n=o=>{let p;o.type==="ImportDeclaration"?p=o.source.value:o.moduleReference.type==="TSExternalModuleReference"&&o.moduleReference.expression.type==="Literal"?p=`${o.moduleReference.expression.value}`:p=e.sourceCode.text.slice(...o.moduleReference.range),l.push({size:I(o.range),group:t(o),name:p,node:o,...i.type===u["line-length"]&&i["max-line-length"]&&{hasMultipleImportDeclarations:a(o)}})};return{TSImportEqualsDeclaration:n,ImportDeclaration:n,"Program:exit":()=>{var y;let o=(d,c)=>!!e.sourceCode.getTokensBetween(d.node,V(c.node,e.sourceCode)||c.node,{includeComments:!0}).length,p=(d,c)=>{let m=[],x={};for(let b of c){let N=h(i.groups,b);N in x?x[N]=v([...x[N],b],i):x[N]=[b]}let C=Object.keys(x).sort((b,N)=>Number(b)-Number(N)).reduce((b,N)=>[...b,...x[N]],[]);for(let b=0,N=C.length;b<N;b++){let E=C.at(b);if(m.push(d.replaceTextRange(M(c.at(b).node,e.sourceCode),e.sourceCode.text.slice(...M(E.node,e.sourceCode)))),i["newlines-between"]!=="ignore"){let w=C.at(b+1);if(w){let R=z(e.sourceCode,c.at(b),c.at(b+1));(i["newlines-between"]==="always"&&h(i.groups,E)===h(i.groups,w)&&R!==0||i["newlines-between"]==="never"&&R>0)&&m.push(d.removeRange([M(c.at(b).node,e.sourceCode).at(1),M(c.at(b+1).node,e.sourceCode).at(0)-1])),i["newlines-between"]==="always"&&h(i.groups,E)!==h(i.groups,w)&&R>1&&m.push(d.replaceTextRange([M(c.at(b).node,e.sourceCode).at(1),M(c.at(b+1).node,e.sourceCode).at(0)-1],` | ||
`)),i["newlines-between"]==="always"&&h(i.groups,E)!==h(i.groups,w)&&R===0&&m.push(d.insertTextAfterRange(M(c.at(b).node,e.sourceCode),` | ||
`))}}}return m},f=[[]];for(let d of l){let c=(y=f.at(-1))==null?void 0:y.at(-1);c&&o(c,d)?f.push([d]):f.at(-1).push(d)}for(let d of f)P(d,(c,m)=>{let x=h(i.groups,c),C=h(i.groups,m),b=z(e.sourceCode,c,m);!(r(c.node)&&r(m.node))&&!o(c,m)&&(x>C||x===C&&O(S(c,m,i)))&&e.report({messageId:"unexpectedImportsOrder",data:{left:c.name,right:m.name},node:m.node,fix:N=>p(N,d)}),i["newlines-between"]==="never"&&b>0&&e.report({messageId:"extraSpacingBetweenImports",data:{left:c.name,right:m.name},node:m.node,fix:N=>p(N,d)}),i["newlines-between"]==="always"&&(x<C&&b===0?e.report({messageId:"missedSpacingBetweenImports",data:{left:c.name,right:m.name},node:m.node,fix:N=>p(N,d)}):(b>1||x===C&&b>0)&&e.report({messageId:"extraSpacingBetweenImports",data:{left:c.name,right:m.name},node:m.node,fix:N=>p(N,d)}))})}}}}),ne="sort-objects",Ae=k({name:ne,meta:{type:"suggestion",docs:{description:"enforce sorted objects"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},"partition-by-comment":{type:["boolean","string","array"],default:!1},"partition-by-new-line":{type:"boolean",default:!1},"styled-components":{type:"boolean",default:!0},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-pattern":{items:{type:"string"},type:"array"},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedObjectsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>{let i=s=>{let l=j(e.options.at(0),{"partition-by-new-line":!1,"partition-by-comment":!1,type:u.alphabetical,"styled-components":!0,"ignore-case":!1,"ignore-pattern":[],order:g.asc,"custom-groups":{},groups:[]}),r=s.parent.type==="VariableDeclarator"&&s.parent.id.type==="Identifier"?s.parent.id.name:null;if(!(l["ignore-pattern"].length&&typeof r=="string"?l["ignore-pattern"].some(a=>D.minimatch(r,a,{nocomment:!0})):!1)&&s.properties.length>1){let a=p=>p.type==="Identifier"&&p.name==="styled",n=p=>p!==void 0&&p.type==="CallExpression"&&(p.callee.type==="MemberExpression"&&a(p.callee.object)||p.callee.type==="CallExpression"&&a(p.callee.callee));if(!l["styled-components"]&&(n(s.parent)||s.parent.type==="ArrowFunctionExpression"&&n(s.parent.parent)))return;let o=p=>p.reduce((f,y)=>{var R;if(y.type==="SpreadElement"||y.type==="RestElement")return f.push([]),f;let d=V(y,e.sourceCode),c=(R=f.at(-1))==null?void 0:R.at(-1);l["partition-by-comment"]&&d&&J(l["partition-by-comment"],d.value)&&f.push([]);let m,x="ignore",C=[],{getGroup:b,setCustomGroups:N}=G(l.groups);y.key.type==="Identifier"?{name:m}=y.key:y.key.type==="Literal"?m=`${y.key.value}`:m=e.sourceCode.text.slice(...y.key.range);let E={size:I(y.range),node:y,name:m};l["partition-by-new-line"]&&c&&z(e.sourceCode,c,E)&&f.push([]),y.value.type==="AssignmentPattern"&&(_=>{_.right.type==="Identifier"&&C.push(_.right.name);let ue=$=>{let U=[];switch($.type){case"ArrowFunctionExpression":U.push($.body);break;case"ConditionalExpression":U.push($.consequent,$.alternate);break;case"LogicalExpression":case"BinaryExpression":U.push($.left,$.right);break;case"CallExpression":U.push(...$.arguments);break}U.forEach(B=>{B.type==="Identifier"&&C.push(B.name),(B.type==="BinaryExpression"||B.type==="ConditionalExpression")&&ue(B)})};switch(_.right.type){case"ArrowFunctionExpression":case"ConditionalExpression":case"LogicalExpression":case"BinaryExpression":case"CallExpression":ue(_.right);break}})(y.value),N(l["custom-groups"],m);let w={...E,group:b(),dependencies:C,position:x};return f.at(-1).push(w),f},[[]]);for(let p of o(s.properties))P(p,(f,y)=>{let d=h(l.groups,f),c=h(l.groups,y);if(d>c||d===c&&O(S(f,y,l))){let m=x=>{let C={};for(let N of p){let E=h(l.groups,N);E in C?C[E]=v([...C[E],N],l):C[E]=[N]}let b=[];for(let N of Object.keys(C).sort((E,w)=>Number(E)-Number(w)))b.push(...v(C[N],l));return L(x,p,b,e.sourceCode,{partitionComment:l["partition-by-comment"]})};e.report({messageId:"unexpectedObjectsOrder",data:{left:A(f.name),right:A(y.name)},node:y.node,fix:m})}})}};return{ObjectExpression:i,ObjectPattern:i}}}),le="sort-classes",ke=k({name:le,meta:{type:"suggestion",docs:{description:"enforce sorted classes"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},"ignore-case":{type:"boolean",default:!1},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},groups:{type:"array",default:[]}},additionalProperties:!1}],messages:{unexpectedClassesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({ClassBody:i=>{if(i.body.length>1){let s=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,groups:["property","constructor","method","unknown"]}),l=i.body.map(r=>{var f;let t,{getGroup:a,defineGroup:n}=G(s.groups);r.type==="StaticBlock"?t="static":r.type==="TSIndexSignature"?t=e.sourceCode.text.slice(r.range.at(0),((f=r.typeAnnotation)==null?void 0:f.range.at(0))??r.range.at(1)):r.key.type==="Identifier"?{name:t}=r.key:t=e.sourceCode.text.slice(...r.key.range);let o=t.startsWith("_")||t.startsWith("#"),p="decorators"in r&&r.decorators.length>0;if(r.type==="MethodDefinition"){r.kind==="constructor"&&n("constructor");let y=r.accessibility==="private"||o,d=r.static;p&&(r.kind==="get"&&n("decorated-get-method"),r.kind==="set"&&n("decorated-set-method"),n("decorated-method")),y&&d&&n("static-private-method"),y&&n("private-method"),d&&n("static-method"),r.kind==="get"&&n("get-method"),r.kind==="set"&&n("set-method"),n("method")}else r.type==="TSIndexSignature"?n("index-signature"):r.type==="AccessorProperty"?p&&((r.accessibility==="private"||o)&&n("private-decorated-accessor-property"),n("decorated-accessor-property")):r.type==="PropertyDefinition"&&(p&&((r.accessibility==="private"||o)&&n("private-decorated-property"),n("decorated-property")),(r.accessibility==="private"||o)&&n("private-property"),r.static&&n("static-property"),n("property"));return{size:I(r.range),group:a(),node:r,name:t}});P(l,(r,t)=>{let a=h(s.groups,r),n=h(s.groups,t);r.name!==t.name&&(a>n||a===n&&O(S(r,t,s)))&&e.report({messageId:"unexpectedClassesOrder",data:{left:A(r.name),right:A(t.name)},node:t.node,fix:o=>{let p=[],f=l.reduce((d,c)=>{let m=h(s.groups,c);return m in d?d[m]=v([...d[m],c],s):d[m]=[c],d},{}),y=Object.keys(f).sort((d,c)=>Number(d)-Number(c)).reduce((d,c)=>[...d,...f[c]],[]);for(let d=0,c=y.length;d<c;d++)p.push(o.replaceTextRange(M(l.at(d).node,e.sourceCode),e.sourceCode.text.slice(...M(y.at(d).node,e.sourceCode))));return p}})})}}})}),ie="sort-enums",Ie=k({name:ie,meta:{type:"suggestion",docs:{description:"enforce sorted TypeScript enums"},fixable:"code",schema:[{type:"object",properties:{"partition-by-comment":{default:!1,type:["boolean","string","array"]},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},"ignore-case":{type:"boolean",default:!1},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"}},additionalProperties:!1}],messages:{unexpectedEnumsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({TSEnumDeclaration:i=>{if(i.members.length>1&&i.members.every(({initializer:s})=>s)){let s=j(e.options.at(0),{type:u.alphabetical,order:g.asc,"ignore-case":!1,"partition-by-comment":!1}),l=s["partition-by-comment"],r=i.members.reduce((t,a)=>{let n=V(a,e.sourceCode);l&&n&&J(l,n.value)&&t.push([]);let p={name:a.id.type==="Literal"?`${a.id.value}`:`${e.sourceCode.text.slice(...a.id.range)}`,node:a,size:I(a.range)};return t.at(-1).push(p),t},[[]]);for(let t of r)P(t,(a,n)=>{O(S(a,n,s))&&e.report({messageId:"unexpectedEnumsOrder",data:{left:A(a.name),right:A(n.name)},node:n.node,fix:o=>L(o,t,v(t,s),e.sourceCode,{partitionComment:l})})})}}})}),pe="sort-maps",Oe=k({name:pe,meta:{type:"suggestion",docs:{description:"enforce sorted Map elements"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[g.asc,g.desc],default:g.asc,type:"string"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedMapElementsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:g.asc}],create:e=>({NewExpression:i=>{if(i.callee.type==="Identifier"&&i.callee.name==="Map"&&i.arguments.length&&i.arguments[0].type==="ArrayExpression"){let[{elements:s}]=i.arguments;if(s.length>1){let l=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:g.asc}),r=s.reduce((t,a)=>(a===null||a.type==="SpreadElement"?t.push([]):t.at(-1).push(a),t),[[]]);for(let t of r){let a=t.map(n=>{let o;if(n.type==="ArrayExpression"){let[p]=n.elements;p?p.type==="Literal"?o=p.raw:o=e.sourceCode.text.slice(...p.range):o=`${p}`}else o=e.sourceCode.text.slice(...n.range);return{size:I(n.range),node:n,name:o}});P(a,(n,o)=>{O(S(n,o,l))&&e.report({messageId:"unexpectedMapElementsOrder",data:{left:A(n.name),right:A(o.name)},node:o.node,fix:p=>L(p,a,v(a,l),e.sourceCode)})})}}}}})}),je="eslint-plugin-perfectionist";let K=e=>{let i={[oe]:["error",{groups:["type",["builtin","external"],"internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],"custom-groups":{value:{},type:{}},"newlines-between":"always","internal-pattern":["~/**"]}],[le]:["error",{groups:["index-signature","static-property","private-property","property","constructor","static-method","private-method","method",["get-method","set-method"],"unknown"]}],[ne]:["error",{"partition-by-comment":!1}],[Q]:["error",{"spread-last":!0}],[X]:["error"],[H]:["error"],[Y]:["error"],[Z]:["error"],[F]:["error"],[ee]:["error"],[te]:["error"],[re]:["error"],[se]:["error"],[ae]:["error"],[ie]:["error"],[pe]:["error"]};return{rules:Object.fromEntries(Object.entries(i).map(([s,[l,r={}]])=>[`perfectionist/${s}`,[l,Object.assign(r,e)]])),plugins:["perfectionist"]}};const Pe={rules:{[Q]:me,[H]:ye,[le]:ke,[ie]:Ie,[ae]:we,[oe]:Se,[re]:Ce,[se]:ve,[pe]:Oe,[Z]:be,[F]:xe,[ee]:Ee,[ne]:Ae,[X]:ge,[te]:Ne,[Y]:he},configs:{"recommended-alphabetical":K({type:u.alphabetical,order:g.asc,"ignore-case":!1}),"recommended-natural":K({type:u.natural,order:g.asc,"ignore-case":!1}),"recommended-line-length":K({type:u["line-length"],order:g.desc})},name:je};module.exports=Pe; | ||
"use strict";const K=require("node:path"),V=require("@typescript-eslint/utils"),B=require("minimatch"),ge=require("natural-compare-lite"),fe=require("@typescript-eslint/types"),ye=require("node:module");let k=V.ESLintUtils.RuleCreator(e=>`https://eslint-plugin-perfectionist.azat.io/rules/${e}`),E=(e,l)=>{for(let a=0,i=e.length;a<i;a++){let s=e[a];if(l.group===s||Array.isArray(s)&&typeof l.group=="string"&&s.includes(l.group))return a}return e.length},I=e=>{let[l,a]=e;return a-l},O=e=>e>0;var u=(e=>(e.alphabetical="alphabetical",e["line-length"]="line-length",e.natural="natural",e))(u||{}),m=(e=>(e.desc="desc",e.asc="asc",e))(m||{}),T=(e=>(e["values-first"]="values-first",e["types-first"]="types-first",e.mixed="mixed",e))(T||{}),G=(e=>(e["optional-first"]="optional-first",e["required-first"]="required-first",e.ignore="ignore",e))(G||{});let R=e=>{let l,a=s=>{!l&&e.flat().includes(s)&&(l=s)};return{getGroup:()=>l??"unknown",setCustomGroups:(s,r)=>{if(s)for(let[n,p]of Object.entries(s))Array.isArray(p)&&p.some(t=>B.minimatch(r,t,{nocomment:!0}))&&a(n),typeof p=="string"&&B.minimatch(r,p,{nocomment:!0})&&a(n)},defineGroup:a}},w=(e,l,a)=>{var n,p;if((n=l.dependencies)!=null&&n.includes(e.name))return-1;if((p=e.dependencies)!=null&&p.includes(l.name))return 1;let i=a.order==="asc"?1:-1,s,r=t=>a["ignore-case"]?t.toLowerCase():t;return a.type===u.alphabetical?s=(t,o)=>r(t.name).localeCompare(r(o.name)):a.type===u.natural?s=(t,o)=>ge(r(t.name),r(o.name)):s=(t,o)=>{let f=t.size,c=o.size,d=a["max-line-length"];if(d){let g=(y,b)=>y>d&&b.hasMultipleImportDeclarations;g(f,t)&&(f=t.name.length+10),g(c,o)&&(c=o.name.length+10)}return f-c},i*s(e,l)},S=(e,l)=>[...e].sort((a,i)=>w(a,i,l)),me=(e,l)=>{let a=l.getTokenAfter(e,{filter:({value:i,type:s})=>!(s==="Punctuator"&&[",",";"].includes(i)),includeComments:!0});return((a==null?void 0:a.type)==="Block"||(a==null?void 0:a.type)==="Line")&&e.loc.end.line===a.loc.end.line?a:null},Y=(e,l)=>Array.isArray(e)&&e.some(a=>B.minimatch(l.trim(),a,{nocomment:!0}))||typeof e=="string"&&B.minimatch(l.trim(),e,{nocomment:!0})||e===!0,J=(e,l)=>{let[a,i]=l.getTokensBefore(e,{filter:({value:s,type:r})=>!(r==="Punctuator"&&[",",";"].includes(s)),includeComments:!0,count:2});return((i==null?void 0:i.type)==="Block"||(i==null?void 0:i.type)==="Line")&&e.loc.start.line-i.loc.end.line<=1&&(a==null?void 0:a.loc.end.line)!==i.loc.start.line?i:null},L=(e,l,a)=>{var p;let i=e.range.at(0),s=e.range.at(1),r=l.text.slice(i,s);if(V.ASTUtils.isParenthesized(e,l)){let t=l.getTokenBefore(e,V.ASTUtils.isOpeningParenToken),o=l.getTokenAfter(e,V.ASTUtils.isClosingParenToken);i=t.range.at(0),s=o.range.at(1)}let n=J(e,l);if(r.endsWith(";")||r.endsWith(",")){let t=l.getTokensAfter(e,{includeComments:!0,count:2});e.loc.start.line===((p=t.at(1))==null?void 0:p.loc.start.line)&&(s-=1)}return n&&!Y((a==null?void 0:a.partitionComment)??!1,n.value)&&(i=n.range.at(0)),[i,s]},M=(e,l,a,i,s)=>{var p,t;let r=[],n=((p=l.at(0))==null?void 0:p.node.loc.start.line)===((t=l.at(-1))==null?void 0:t.node.loc.end.line);for(let o=0,f=l.length;o<f;o++){let{node:c}=l.at(o);r.push(e.replaceTextRange(L(c,i,s),i.text.slice(...L(a.at(o).node,i,s))));let d=me(a.at(o).node,i);if(d&&!n){let y=[i.getTokenBefore(d).range.at(1),d.range.at(1)];r.push(e.replaceTextRange(y,""));let b=i.getTokenAfter(c);r.push(e.insertTextAfter((b==null?void 0:b.loc.end.line)===c.loc.end.line?b:c,i.text.slice(...y)))}}return r},j=(e={},l)=>Object.assign(l,e),P=(e,l)=>{if(e.length>1)for(let a=1;a<e.length;a++){let i=e.at(a-1),s=e.at(a);i&&s&&l(i,s,a-1)}};const H="sort-svelte-attributes",he=k({name:H,meta:{type:"suggestion",docs:{description:"enforce sorted Svelte attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedSvelteAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>K.extname(e.filename)!==".svelte"?{}:{SvelteStartTag:l=>{if(l.attributes.length>1){let a=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),i=l.attributes.reduce((s,r)=>{if(r.type==="SvelteSpreadAttribute")return s.push([]),s;let n,{getGroup:p,defineGroup:t,setCustomGroups:o}=R(a.groups);return r.key.type==="SvelteSpecialDirectiveKey"?n=e.sourceCode.text.slice(...r.key.range):typeof r.key.name=="string"?{name:n}=r.key:n=e.sourceCode.text.slice(...r.key.range),o(a["custom-groups"],n),r.type==="SvelteShorthandAttribute"&&(t("svelte-shorthand"),t("shorthand")),(!("value"in r)||Array.isArray(r.value)&&!r.value.at(0))&&t("shorthand"),r.loc.start.line!==r.loc.end.line&&t("multiline"),s.at(-1).push({size:I(r.range),node:r,group:p(),name:n}),s},[[]]);for(let s of i)P(s,(r,n)=>{let p=E(a.groups,r),t=E(a.groups,n);(p>t||p===t&&O(w(r,n,a)))&&e.report({messageId:"unexpectedSvelteAttributesOrder",data:{left:r.name,right:n.name},node:n.node,fix:o=>{let f={};for(let d of s){let g=E(a.groups,d);g in f?f[g]=S([...f[g],d],a):f[g]=[d]}let c=[];for(let d of Object.keys(f).sort((g,y)=>Number(g)-Number(y)))c.push(...S(f[d],a));return M(o,s,c,e.sourceCode)}})})}}}}),Q="sort-astro-attributes",be=k({name:Q,meta:{type:"suggestion",docs:{description:"enforce sorted Astro attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedAstroAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>K.extname(e.filename)!==".astro"?{}:{JSXElement:l=>{let{attributes:a}=l.openingElement;if(a.length>1){let i=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),s=a.reduce((r,n)=>{if(n.type==="JSXSpreadAttribute")return r.push([]),r;let p=typeof n.name.name=="string"?n.name.name:e.sourceCode.text.slice(...n.name.range),{getGroup:t,defineGroup:o,setCustomGroups:f}=R(i.groups);return f(i["custom-groups"],p),n.type==="AstroShorthandAttribute"&&(o("astro-shorthand"),o("shorthand")),n.value===null&&o("shorthand"),n.loc.start.line!==n.loc.end.line&&o("multiline"),r.at(-1).push({size:I(n.range),node:n,group:t(),name:p}),r},[[]]);for(let r of s)P(r,(n,p)=>{let t=E(i.groups,n),o=E(i.groups,p);(t>o||t===o&&O(w(n,p,i)))&&e.report({messageId:"unexpectedAstroAttributesOrder",data:{left:n.name,right:p.name},node:p.node,fix:f=>{let c={};for(let g of r){let y=E(i.groups,g);y in c?c[y]=S([...c[y],g],i):c[y]=[g]}let d=[];for(let g of Object.keys(c).sort((y,b)=>Number(y)-Number(b)))d.push(...S(c[g],i));return M(f,r,d,e.sourceCode)}})})}}}});let A=e=>e.replaceAll(/\s\s+/g," ").trim();const Z="sort-array-includes",xe=k({name:Z,meta:{type:"suggestion",docs:{description:"enforce sorted arrays before include method"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"spread-last":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedArrayIncludesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({MemberExpression:l=>{if((l.object.type==="ArrayExpression"||l.object.type==="NewExpression")&&l.property.type==="Identifier"&&l.property.name==="includes"){let a=l.object.type==="ArrayExpression"?l.object.elements:l.object.arguments;if(a.length>1){let i=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,"spread-last":!1}),s=a.reduce((r,n)=>(n!==null&&r.at(0).push({name:n.type==="Literal"?`${n.value}`:e.sourceCode.text.slice(...n.range),size:I(n.range),type:n.type,node:n}),r),[[],[]]).flat();P(s,(r,n)=>{let p;i["spread-last"]&&r.node.type==="Literal"&&n.node.type==="SpreadElement"?p=!1:i["spread-last"]&&r.node.type==="SpreadElement"&&n.node.type==="Literal"?p=!0:p=O(w(r,n,i)),p&&e.report({messageId:"unexpectedArrayIncludesOrder",data:{left:A(r.name),right:A(n.name)},node:n.node,fix:t=>{let o=S(s,i);if(i["spread-last"])for(let f=0,c=o.length;f<c;f++)o.at(f).node.type==="SpreadElement"&&o.push(o.splice(f,1).at(0));return M(t,s,o,e.sourceCode)}})})}}}})}),F="sort-vue-attributes",Ee=k({name:F,meta:{type:"suggestion",docs:{description:"enforce sorted Vue attributes"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]}},additionalProperties:!1}],messages:{unexpectedVueAttributesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>{if(K.extname(e.filename)!==".vue")return{};if(!("defineTemplateBodyVisitor"in e.sourceCode.parserServices))return{};let{defineTemplateBodyVisitor:l}=e.sourceCode.parserServices;return l({VStartTag:a=>{if(a.attributes.length>1){let i=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,"custom-groups":{},groups:[]}),s=a.attributes.reduce((r,n)=>{if(n.key.type==="VDirectiveKey"&&n.key.name.rawName==="bind")return r.push([]),r;let p,{getGroup:t,defineGroup:o,setCustomGroups:f}=R(i.groups);return typeof n.key.name=="string"&&n.key.type!=="VDirectiveKey"?p=n.key.rawName:p=e.sourceCode.text.slice(...n.key.range),f(i["custom-groups"],p),n.value===null&&o("shorthand"),n.loc.start.line!==n.loc.end.line&&o("multiline"),r.at(-1).push({size:I(n.range),node:n,group:t(),name:p}),r},[[]]);for(let r of s)P(r,(n,p)=>{let t=E(i.groups,n),o=E(i.groups,p);(t>o||t===o&&O(w(n,p,i)))&&e.report({messageId:"unexpectedVueAttributesOrder",data:{left:n.name,right:p.name},node:p.node,fix:f=>{let c={};for(let g of r){let y=E(i.groups,g);y in c?c[y]=S([...c[y],g],i):c[y]=[g]}let d=[];for(let g of Object.keys(c).sort((y,b)=>Number(y)-Number(b)))d.push(...S(c[g],i));return M(f,r,d,e.sourceCode)}})})}}})}}),ee="sort-named-exports",Ne=k({name:ee,meta:{type:"suggestion",docs:{description:"enforce sorted named exports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"group-kind":{enum:[T.mixed,T["values-first"],T["types-first"]],default:T.mixed,type:"string"}},additionalProperties:!1}],messages:{unexpectedNamedExportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({ExportNamedDeclaration:l=>{if(l.specifiers.length>1){let a=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:m.asc,"group-kind":T.mixed}),i=l.specifiers.map(n=>({size:I(n.range),name:n.local.name,node:n,group:n.exportKind})),s=a["group-kind"]!==T.mixed,r=a["group-kind"]===T["values-first"]?["value","type"]:["type","value"];P(i,(n,p)=>{let t=E(r,n),o=E(r,p);if(s&&t>o||(!s||t===o)&&O(w(n,p,a))){let f=s?r.map(c=>i.filter(d=>d.group===c)).map(c=>S(c,a)).flat():S(i,a);e.report({messageId:"unexpectedNamedExportsOrder",data:{left:n.name,right:p.name},node:p.node,fix:c=>M(c,i,f,e.sourceCode)})}})}}})}),te="sort-named-imports",Ce=k({name:te,meta:{type:"suggestion",docs:{description:"enforce sorted named imports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-alias":{type:"boolean",default:!1},"group-kind":{enum:[T.mixed,T["values-first"],T["types-first"]],default:T.mixed,type:"string"}},additionalProperties:!1}],messages:{unexpectedNamedImportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({ImportDeclaration:l=>{let a=l.specifiers.filter(({type:i})=>i==="ImportSpecifier");if(a.length>1){let i=j(e.options.at(0),{type:u.alphabetical,"ignore-alias":!0,"ignore-case":!1,order:m.asc,"group-kind":T.mixed}),s=a.map(p=>{let t,{name:o}=p.local;return p.type==="ImportSpecifier"&&(i["ignore-alias"]&&({name:o}=p.imported),t=p.importKind),{size:I(p.range),node:p,name:o,group:t}}),r=i["group-kind"]!==T.mixed,n=i["group-kind"]===T["values-first"]?["value","type"]:["type","value"];P(s,(p,t)=>{let o=E(n,p),f=E(n,t);if(r&&o>f||(!r||o===f)&&O(w(p,t,i))){let c=r?n.map(d=>s.filter(g=>g.group===d)).map(d=>S(d,i)).flat():S(s,i);e.report({messageId:"unexpectedNamedImportsOrder",data:{left:p.name,right:t.name},node:t.node,fix:d=>M(d,s,c,e.sourceCode)})}})}}})});let q=(e,l,a)=>e.lines.slice(l.node.loc.end.line,a.node.loc.start.line-1).filter(s=>!s.trim().length).length;const re="sort-object-types",Se=k({name:re,meta:{type:"suggestion",docs:{description:"enforce sorted object types"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]},"partition-by-new-line":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedObjectTypesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({TSTypeLiteral:l=>{if(l.members.length>1){let a=j(e.options.at(0),{"partition-by-new-line":!1,type:u.alphabetical,"ignore-case":!1,order:m.asc,"custom-groups":{},groups:[]}),i=l.members.reduce((s,r)=>{var C,h,N,x;let n,p=e.sourceCode.text.slice(r.range.at(0),r.range.at(1)),t=(C=s.at(-1))==null?void 0:C.at(-1),{getGroup:o,defineGroup:f,setCustomGroups:c}=R(a.groups),d=v=>v.replace(/(,|;)$/,"");if(r.type==="TSPropertySignature")r.key.type==="Identifier"?{name:n}=r.key:r.key.type==="Literal"?n=`${r.key.value}`:n=e.sourceCode.text.slice(r.range.at(0),(h=r.typeAnnotation)==null?void 0:h.range.at(0));else if(r.type==="TSIndexSignature"){let v=((N=r.typeAnnotation)==null?void 0:N.range.at(0))??r.range.at(1);n=d(e.sourceCode.text.slice(r.range.at(0),v))}else n=d(e.sourceCode.text.slice(r.range.at(0),r.range.at(1)));c(a["custom-groups"],n),r.loc.start.line!==r.loc.end.line&&f("multiline");let y=p.endsWith(";")||p.endsWith(",")?1:0,b={size:I(r.range)-y,node:r,name:n};return a["partition-by-new-line"]&&t&&q(e.sourceCode,t,b)&&s.push([]),(x=s.at(-1))==null||x.push({...b,group:o()}),s},[[]]);for(let s of i)P(s,(r,n)=>{let p=E(a.groups,r),t=E(a.groups,n);(p>t||p===t&&O(w(r,n,a)))&&e.report({messageId:"unexpectedObjectTypesOrder",data:{left:A(r.name),right:A(n.name)},node:n.node,fix:o=>{let f={};for(let d of s){let g=E(a.groups,d);g in f?f[g]=S([...f[g],d],a):f[g]=[d]}let c=[];for(let d of Object.keys(f).sort((g,y)=>Number(g)-Number(y)))c.push(...S(f[d],a));return M(o,s,c,e.sourceCode)}})})}}})}),se="sort-union-types",ve=k({name:se,meta:{type:"suggestion",docs:{description:"enforce sorted union types"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"nullable-last":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedUnionTypesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({TSUnionType:l=>{let a=j(e.options.at(0),{type:u.alphabetical,"nullable-last":!1,"ignore-case":!1,order:m.asc}),i=l.types.map(s=>({group:s.type==="TSNullKeyword"||s.type==="TSUndefinedKeyword"?"nullable":"unknown",name:e.sourceCode.text.slice(...s.range),size:I(s.range),node:s}));P(i,(s,r)=>{let n=O(w(s,r,a));a["nullable-last"]&&(s.group==="nullable"&&r.group==="unknown"?n=!0:s.group==="unknown"&&r.group==="nullable"&&(n=!1)),n&&e.report({messageId:"unexpectedUnionTypesOrder",data:{left:A(s.name),right:A(r.name)},node:r.node,fix:p=>{let t=[];if(a["nullable-last"]){let o=[],f=i.filter(c=>c.group==="nullable"?(o.push(c),!1):!0);t=[...S(f,a),...S(o,a)]}else t=S(i,a);return M(p,i,t,e.sourceCode)}})})}})});let U=e=>{switch(e.type){case fe.AST_NODE_TYPES.TSMethodSignature:case fe.AST_NODE_TYPES.TSPropertySignature:return e.optional}return!1};const ae="sort-interfaces",we=k({name:ae,meta:{type:"suggestion",docs:{description:"enforce sorted interface properties"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},"optionality-order":{enum:[G.ignore,G["optional-first"],G["required-first"]],default:G.ignore,type:"string"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-pattern":{items:{type:"string"},type:"array"},groups:{type:"array",default:[]},"partition-by-new-line":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedInterfacePropertiesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({TSInterfaceDeclaration:l=>{if(l.body.body.length>1){let a=j(e.options.at(0),{"optionality-order":G.ignore,"partition-by-new-line":!1,type:u.alphabetical,"ignore-case":!1,order:m.asc,"ignore-pattern":[],"custom-groups":{},groups:[]});if(!a["ignore-pattern"].some(i=>B.minimatch(l.id.name,i,{nocomment:!0}))){let i=l.body.body.reduce((t,o)=>{var C,h,N,x;if(o.type==="TSCallSignatureDeclaration")return t.push([]),t;let f=(C=t.at(-1))==null?void 0:C.at(-1),c,{getGroup:d,defineGroup:g,setCustomGroups:y}=R(a.groups);if(o.type==="TSPropertySignature")if(o.key.type==="Identifier")({name:c}=o.key);else if(o.key.type==="Literal")c=`${o.key.value}`;else{let v=((h=o.typeAnnotation)==null?void 0:h.range.at(0))??o.range.at(1)-(o.optional?1:0);c=e.sourceCode.text.slice(o.range.at(0),v)}else if(o.type==="TSIndexSignature"){let v=((N=o.typeAnnotation)==null?void 0:N.range.at(0))??o.range.at(1);c=e.sourceCode.text.slice(o.range.at(0),v)}else{let v=((x=o.returnType)==null?void 0:x.range.at(0))??o.range.at(1);c=e.sourceCode.text.slice(o.range.at(0),v)}let b={size:I(o.range),node:o,name:c};return a["partition-by-new-line"]&&f&&q(e.sourceCode,f,b)&&t.push([]),y(a["custom-groups"],c),o.loc.start.line!==o.loc.end.line&&g("multiline"),t.at(-1).push({...b,group:d()}),t},[[]]),s=t=>{let o={};for(let c of t){let d=E(a.groups,c);d in o?o[d]=S([...o[d],c],a):o[d]=[c]}let f=[];for(let c of Object.keys(o).sort((d,g)=>Number(d)-Number(g)))f.push(...S(o[c],a));return f},r=(t,o)=>{let f=E(a.groups,t),c=E(a.groups,o);return f>c||f===c&&O(w(t,o,a))},n=a["optionality-order"],p=(t,o,f,c)=>{if(n===G.ignore)return r(o,f);let d=t.findIndex((g,y)=>y&&U(t[y-1].node)!==U(t[y].node));return c<d&&c+1!==d?r(o,f):U(o.node)!==U(f.node)?U(o.node)!==(n===G["optional-first"]):r(o,f)};for(let t of i)P(t,(o,f,c)=>{p(t,o,f,c)&&e.report({messageId:"unexpectedInterfacePropertiesOrder",data:{left:A(o.name),right:A(f.name)},node:f.node,fix:d=>{let g;if(n!==G.ignore){let y=t.filter(C=>U(C.node)),b=t.filter(C=>!U(C.node));g=n===G["optional-first"]?[...s(y),...s(b)]:[...s(b),...s(y)]}else g=s(t);return M(d,t,g,e.sourceCode)}})})}}}})}),oe="sort-jsx-props",Ae=k({name:oe,meta:{type:"suggestion",docs:{description:"enforce sorted JSX props"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},groups:{type:"array"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedJSXPropsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>[".svelte",".astro",".vue"].includes(K.extname(e.filename))?{}:{JSXElement:l=>{if(l.openingElement.attributes.length>1){let a=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:m.asc,"custom-groups":{},groups:[]}),i=l.openingElement.attributes.reduce((s,r)=>{if(r.type==="JSXSpreadAttribute")return s.push([]),s;let n=r.name.type==="JSXNamespacedName"?`${r.name.namespace.name}:${r.name.name.name}`:r.name.name,{getGroup:p,defineGroup:t,setCustomGroups:o}=R(a.groups);o(a["custom-groups"],n),r.value===null&&t("shorthand"),r.loc.start.line!==r.loc.end.line&&t("multiline");let f={size:I(r.range),group:p(),node:r,name:n};return s.at(-1).push(f),s},[[]]);for(let s of i)P(s,(r,n)=>{let p=E(a.groups,r),t=E(a.groups,n);(p>t||p===t&&O(w(r,n,a)))&&e.report({messageId:"unexpectedJSXPropsOrder",data:{left:r.name,right:n.name},node:n.node,fix:o=>{let f={};for(let d of s){let g=E(a.groups,d);g in f?f[g]=S([...f[g],d],a):f[g]=[d]}let c=[];for(let d of Object.keys(f).sort((g,y)=>Number(g)-Number(y)))c.push(...S(f[d],a));return M(o,s,c,e.sourceCode)}})})}}}}),ne="sort-exports",ke=k({name:ne,meta:{type:"suggestion",docs:{description:"enforce sorted exports"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedExportsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>{let l=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1}),a=[[]],i=s=>{s.type==="ExportAllDeclaration"&&s.exported===null?a.push([]):a.at(-1).push({size:I(s.range),name:s.source.value,node:s})};return{ExportAllDeclaration:i,ExportNamedDeclaration:s=>{s.source!==null&&i(s)},"Program:exit":()=>{for(let s of a)P(s,(r,n)=>{O(w(r,n,l))&&e.report({messageId:"unexpectedExportsOrder",data:{left:r.name,right:n.name},node:n.node,fix:p=>M(p,s,S(s,l),e.sourceCode)})})}}}}),ie="sort-imports",Ie=k({name:ie,meta:{type:"suggestion",docs:{description:"enforce sorted imports"},fixable:"code",schema:[{id:"sort-imports",type:"object",properties:{"custom-groups":{type:"object",properties:{type:{type:"object"},value:{type:"object"}},additionalProperties:!1},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},groups:{type:"array",default:[]},"internal-pattern":{items:{type:"string"},type:"array"},"newlines-between":{enum:["ignore","always","never"],default:"always",type:"string"},"max-line-length":{type:"integer",minimum:0,exclusiveMinimum:!0}},allOf:[{$ref:"#/definitions/max-line-length-requires-line-length-type"}],additionalProperties:!1,dependencies:{"max-line-length":["type"]},definitions:{"is-line-length":{properties:{type:{enum:[u["line-length"]],type:"string"}},required:["type"],type:"object"},"max-line-length-requires-line-length-type":{anyOf:[{not:{required:["max-line-length"],type:"object"},type:"object"},{$ref:"#/definitions/is-line-length"}]}}}],messages:{unexpectedImportsOrder:'Expected "{{right}}" to come before "{{left}}"',missedSpacingBetweenImports:'Missed spacing between "{{left}}" and "{{right}}" imports',extraSpacingBetweenImports:'Extra spacing between "{{left}}" and "{{right}}" imports'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>{let l=j(e.options.at(0),{"newlines-between":"always","custom-groups":{type:{},value:{}},"internal-pattern":["~/**"],type:u.alphabetical,order:m.asc,"ignore-case":!1,groups:[]}),a=!1;for(let t of l.groups)if(Array.isArray(t))for(let o of t)o==="unknown"&&(a=!0);else t==="unknown"&&(a=!0);a||(l.groups=[...l.groups,"unknown"]);let i=[],s=t=>t.type==="ImportDeclaration"&&t.specifiers.length===0,r=t=>{let o=x=>[".less",".scss",".sass",".styl",".pcss",".css",".sss"].some(v=>x.endsWith(v)),f=x=>["./index.d.js","./index.d.ts","./index.js","./index.ts","./index","./","."].includes(x),c=x=>x.indexOf("..")===0,d=x=>x.indexOf("./")===0,{getGroup:g,defineGroup:y,setCustomGroups:b}=R(l.groups),C=x=>l["internal-pattern"].length&&l["internal-pattern"].some(v=>B.minimatch(x.source.value,v,{nocomment:!0})),h=x=>{let v=["bun","bun:ffi","bun:jsc","bun:sqlite","bun:test","bun:wrap","detect-libc","undici","ws"];return ye.builtinModules.includes(x.startsWith("node:")?x.split("node:")[1]:x)||v.includes(x)},N=x=>!(x.startsWith(".")||x.startsWith("/"));return t.importKind==="type"&&(t.type==="ImportDeclaration"&&(b(l["custom-groups"].type,t.source.value),f(t.source.value)&&y("index-type"),d(t.source.value)&&y("sibling-type"),c(t.source.value)&&y("parent-type"),C(t)&&y("internal-type"),h(t.source.value)&&y("builtin-type"),N(t.source.value)&&y("external-type")),y("type")),t.type==="ImportDeclaration"&&(b(l["custom-groups"].value,t.source.value),s(t)&&o(t.source.value)&&y("side-effect-style"),s(t)&&y("side-effect"),o(t.source.value)&&y("style"),f(t.source.value)&&y("index"),d(t.source.value)&&y("sibling"),c(t.source.value)&&y("parent"),C(t)&&y("internal"),h(t.source.value)&&y("builtin"),N(t.source.value)&&y("external")),g()},n=t=>t.specifiers.length>1,p=t=>{let o;t.type==="ImportDeclaration"?o=t.source.value:t.moduleReference.type==="TSExternalModuleReference"&&t.moduleReference.expression.type==="Literal"?o=`${t.moduleReference.expression.value}`:o=e.sourceCode.text.slice(...t.moduleReference.range),i.push({size:I(t.range),group:r(t),name:o,node:t,...l.type===u["line-length"]&&l["max-line-length"]&&{hasMultipleImportDeclarations:n(t)}})};return{TSImportEqualsDeclaration:p,ImportDeclaration:p,"Program:exit":()=>{var c;let t=(d,g)=>!!e.sourceCode.getTokensBetween(d.node,J(g.node,e.sourceCode)||g.node,{includeComments:!0}).length,o=(d,g)=>{let y=[],b={};for(let h of g){let N=E(l.groups,h);N in b?b[N]=S([...b[N],h],l):b[N]=[h]}let C=Object.keys(b).sort((h,N)=>Number(h)-Number(N)).reduce((h,N)=>[...h,...b[N]],[]);for(let h=0,N=C.length;h<N;h++){let x=C.at(h);if(y.push(d.replaceTextRange(L(g.at(h).node,e.sourceCode),e.sourceCode.text.slice(...L(x.node,e.sourceCode)))),l["newlines-between"]!=="ignore"){let v=C.at(h+1);if(v){let $=q(e.sourceCode,g.at(h),g.at(h+1));(l["newlines-between"]==="always"&&E(l.groups,x)===E(l.groups,v)&&$!==0||l["newlines-between"]==="never"&&$>0)&&y.push(d.removeRange([L(g.at(h).node,e.sourceCode).at(1),L(g.at(h+1).node,e.sourceCode).at(0)-1])),l["newlines-between"]==="always"&&E(l.groups,x)!==E(l.groups,v)&&$>1&&y.push(d.replaceTextRange([L(g.at(h).node,e.sourceCode).at(1),L(g.at(h+1).node,e.sourceCode).at(0)-1],` | ||
`)),l["newlines-between"]==="always"&&E(l.groups,x)!==E(l.groups,v)&&$===0&&y.push(d.insertTextAfterRange(L(g.at(h).node,e.sourceCode),` | ||
`))}}}return y},f=[[]];for(let d of i){let g=(c=f.at(-1))==null?void 0:c.at(-1);g&&t(g,d)?f.push([d]):f.at(-1).push(d)}for(let d of f)P(d,(g,y)=>{let b=E(l.groups,g),C=E(l.groups,y),h=q(e.sourceCode,g,y);!(s(g.node)&&s(y.node))&&!t(g,y)&&(b>C||b===C&&O(w(g,y,l)))&&e.report({messageId:"unexpectedImportsOrder",data:{left:g.name,right:y.name},node:y.node,fix:N=>o(N,d)}),l["newlines-between"]==="never"&&h>0&&e.report({messageId:"extraSpacingBetweenImports",data:{left:g.name,right:y.name},node:y.node,fix:N=>o(N,d)}),l["newlines-between"]==="always"&&(b<C&&h===0?e.report({messageId:"missedSpacingBetweenImports",data:{left:g.name,right:y.name},node:y.node,fix:N=>o(N,d)}):(h>1||b===C&&h>0)&&e.report({messageId:"extraSpacingBetweenImports",data:{left:g.name,right:y.name},node:y.node,fix:N=>o(N,d)}))})}}}}),le="sort-objects",Oe=k({name:le,meta:{type:"suggestion",docs:{description:"enforce sorted objects"},fixable:"code",schema:[{type:"object",properties:{"custom-groups":{type:"object"},"partition-by-comment":{type:["boolean","string","array"],default:!1},"partition-by-new-line":{type:"boolean",default:!1},"styled-components":{type:"boolean",default:!0},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1},"ignore-pattern":{items:{type:"string"},type:"array"},groups:{type:"array"}},additionalProperties:!1}],messages:{unexpectedObjectsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>{let l=a=>{let i=j(e.options.at(0),{"partition-by-new-line":!1,"partition-by-comment":!1,type:u.alphabetical,"styled-components":!0,"ignore-case":!1,"ignore-pattern":[],order:m.asc,"custom-groups":{},groups:[]}),s=a.parent.type==="VariableDeclarator"&&a.parent.id.type==="Identifier"?a.parent.id.name:null;if(!(i["ignore-pattern"].length&&typeof s=="string"?i["ignore-pattern"].some(n=>B.minimatch(s,n,{nocomment:!0})):!1)&&a.properties.length>1){let n=o=>o.type==="Identifier"&&o.name==="styled",p=o=>o!==void 0&&o.type==="CallExpression"&&(o.callee.type==="MemberExpression"&&n(o.callee.object)||o.callee.type==="CallExpression"&&n(o.callee.callee));if(!i["styled-components"]&&(p(a.parent)||a.parent.type==="ArrowFunctionExpression"&&p(a.parent.parent)))return;let t=o=>o.reduce((f,c)=>{var $;if(c.type==="SpreadElement"||c.type==="RestElement")return f.push([]),f;let d=J(c,e.sourceCode),g=($=f.at(-1))==null?void 0:$.at(-1);i["partition-by-comment"]&&d&&Y(i["partition-by-comment"],d.value)&&f.push([]);let y,b="ignore",C=[],{getGroup:h,setCustomGroups:N}=R(i.groups);c.key.type==="Identifier"?{name:y}=c.key:c.key.type==="Literal"?y=`${c.key.value}`:y=e.sourceCode.text.slice(...c.key.range);let x={size:I(c.range),node:c,name:y};i["partition-by-new-line"]&&g&&q(e.sourceCode,g,x)&&f.push([]),c.value.type==="AssignmentPattern"&&(W=>{W.right.type==="Identifier"&&C.push(W.right.name);let ce=D=>{let z=[];switch(D.type){case"ArrowFunctionExpression":z.push(D.body);break;case"ConditionalExpression":z.push(D.consequent,D.alternate);break;case"LogicalExpression":case"BinaryExpression":z.push(D.left,D.right);break;case"CallExpression":z.push(...D.arguments);break}z.forEach(_=>{_.type==="Identifier"&&C.push(_.name),(_.type==="BinaryExpression"||_.type==="ConditionalExpression")&&ce(_)})};switch(W.right.type){case"ArrowFunctionExpression":case"ConditionalExpression":case"LogicalExpression":case"BinaryExpression":case"CallExpression":ce(W.right);break}})(c.value),N(i["custom-groups"],y);let v={...x,group:h(),dependencies:C,position:b};return f.at(-1).push(v),f},[[]]);for(let o of t(a.properties))P(o,(f,c)=>{let d=E(i.groups,f),g=E(i.groups,c);if(d>g||d===g&&O(w(f,c,i))){let y=b=>{let C={};for(let N of o){let x=E(i.groups,N);x in C?C[x]=S([...C[x],N],i):C[x]=[N]}let h=[];for(let N of Object.keys(C).sort((x,v)=>Number(x)-Number(v)))h.push(...S(C[N],i));return M(b,o,h,e.sourceCode,{partitionComment:i["partition-by-comment"]})};e.report({messageId:"unexpectedObjectsOrder",data:{left:A(f.name),right:A(c.name)},node:c.node,fix:y})}})}};return{ObjectExpression:l,ObjectPattern:l}}}),pe="sort-classes",je=k({name:pe,meta:{type:"suggestion",docs:{description:"enforce sorted classes"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},"ignore-case":{type:"boolean",default:!1},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},groups:{type:"array",default:[]}},additionalProperties:!1}],messages:{unexpectedClassesOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({ClassBody:l=>{if(l.body.length>1){let a=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,groups:["property","constructor","method","unknown"]}),i=l.body.map(s=>{var f;let r,{getGroup:n,defineGroup:p}=R(a.groups);s.type==="StaticBlock"?r="static":s.type==="TSIndexSignature"?r=e.sourceCode.text.slice(s.range.at(0),((f=s.typeAnnotation)==null?void 0:f.range.at(0))??s.range.at(1)):s.key.type==="Identifier"?{name:r}=s.key:r=e.sourceCode.text.slice(...s.key.range);let t=r.startsWith("_")||r.startsWith("#"),o="decorators"in s&&s.decorators.length>0;if(s.type==="MethodDefinition"){s.kind==="constructor"&&p("constructor");let c=s.accessibility==="private"||t,d=s.static;o&&(s.kind==="get"&&p("decorated-get-method"),s.kind==="set"&&p("decorated-set-method"),p("decorated-method")),c&&d&&p("static-private-method"),c&&p("private-method"),d&&p("static-method"),s.kind==="get"&&p("get-method"),s.kind==="set"&&p("set-method"),p("method")}else s.type==="TSIndexSignature"?p("index-signature"):s.type==="AccessorProperty"?o&&((s.accessibility==="private"||t)&&p("private-decorated-accessor-property"),p("decorated-accessor-property")):s.type==="PropertyDefinition"&&(o&&((s.accessibility==="private"||t)&&p("private-decorated-property"),p("decorated-property")),(s.accessibility==="private"||t)&&p("private-property"),s.static&&p("static-property"),p("property"));return{size:I(s.range),group:n(),node:s,name:r}});P(i,(s,r)=>{let n=E(a.groups,s),p=E(a.groups,r);s.name!==r.name&&(n>p||n===p&&O(w(s,r,a)))&&e.report({messageId:"unexpectedClassesOrder",data:{left:A(s.name),right:A(r.name)},node:r.node,fix:t=>{let o=[],f=i.reduce((d,g)=>{let y=E(a.groups,g);return y in d?d[y]=S([...d[y],g],a):d[y]=[g],d},{}),c=Object.keys(f).sort((d,g)=>Number(d)-Number(g)).reduce((d,g)=>[...d,...f[g]],[]);for(let d=0,g=c.length;d<g;d++)o.push(t.replaceTextRange(L(i.at(d).node,e.sourceCode),e.sourceCode.text.slice(...L(c.at(d).node,e.sourceCode))));return o}})})}}})}),ue="sort-enums",Pe=k({name:ue,meta:{type:"suggestion",docs:{description:"enforce sorted TypeScript enums"},fixable:"code",schema:[{type:"object",properties:{"partition-by-comment":{default:!1,type:["boolean","string","array"]},type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},"ignore-case":{type:"boolean",default:!1},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"}},additionalProperties:!1}],messages:{unexpectedEnumsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({TSEnumDeclaration:l=>{if(l.members.length>1&&l.members.every(({initializer:a})=>a)){let a=j(e.options.at(0),{type:u.alphabetical,order:m.asc,"ignore-case":!1,"partition-by-comment":!1}),i=a["partition-by-comment"],s=l.members.reduce((r,n)=>{let p=J(n,e.sourceCode);i&&p&&Y(i,p.value)&&r.push([]);let o={name:n.id.type==="Literal"?`${n.id.value}`:`${e.sourceCode.text.slice(...n.id.range)}`,node:n,size:I(n.range)};return r.at(-1).push(o),r},[[]]);for(let r of s)P(r,(n,p)=>{O(w(n,p,a))&&e.report({messageId:"unexpectedEnumsOrder",data:{left:A(n.name),right:A(p.name)},node:p.node,fix:t=>M(t,r,S(r,a),e.sourceCode,{partitionComment:i})})})}}})}),de="sort-maps",Te=k({name:de,meta:{type:"suggestion",docs:{description:"enforce sorted Map elements"},fixable:"code",schema:[{type:"object",properties:{type:{enum:[u.alphabetical,u.natural,u["line-length"]],default:u.alphabetical,type:"string"},order:{enum:[m.asc,m.desc],default:m.asc,type:"string"},"ignore-case":{type:"boolean",default:!1}},additionalProperties:!1}],messages:{unexpectedMapElementsOrder:'Expected "{{right}}" to come before "{{left}}"'}},defaultOptions:[{type:u.alphabetical,order:m.asc}],create:e=>({NewExpression:l=>{if(l.callee.type==="Identifier"&&l.callee.name==="Map"&&l.arguments.length&&l.arguments[0].type==="ArrayExpression"){let[{elements:a}]=l.arguments;if(a.length>1){let i=j(e.options.at(0),{type:u.alphabetical,"ignore-case":!1,order:m.asc}),s=a.reduce((r,n)=>(n===null||n.type==="SpreadElement"?r.push([]):r.at(-1).push(n),r),[[]]);for(let r of s){let n=r.map(p=>{let t;if(p.type==="ArrayExpression"){let[o]=p.elements;o?o.type==="Literal"?t=o.raw:t=e.sourceCode.text.slice(...o.range):t=`${o}`}else t=e.sourceCode.text.slice(...p.range);return{size:I(p.range),node:p,name:t}});P(n,(p,t)=>{O(w(p,t,i))&&e.report({messageId:"unexpectedMapElementsOrder",data:{left:A(p.name),right:A(t.name)},node:t.node,fix:o=>M(o,n,S(n,i),e.sourceCode)})})}}}}})}),Me="eslint-plugin-perfectionist";let X=e=>{let l={[ie]:["error",{groups:["type",["builtin","external"],"internal-type","internal",["parent-type","sibling-type","index-type"],["parent","sibling","index"],"object","unknown"],"custom-groups":{value:{},type:{}},"newlines-between":"always","internal-pattern":["~/**"]}],[pe]:["error",{groups:["index-signature","static-property","private-property","property","constructor","static-method","private-method","method",["get-method","set-method"],"unknown"]}],[le]:["error",{"partition-by-comment":!1}],[Z]:["error",{"spread-last":!0}],[H]:["error"],[Q]:["error"],[F]:["error"],[ee]:["error"],[te]:["error"],[re]:["error"],[se]:["error"],[ae]:["error"],[oe]:["error"],[ne]:["error"],[ue]:["error"],[de]:["error"]};return{rules:Object.fromEntries(Object.entries(l).map(([a,[i,s={}]])=>[`perfectionist/${a}`,[i,Object.assign(s,e)]])),plugins:["perfectionist"]}};const Le={rules:{[Z]:xe,[Q]:be,[pe]:je,[ue]:Pe,[ne]:ke,[ie]:Ie,[ae]:we,[oe]:Ae,[de]:Te,[ee]:Ne,[te]:Ce,[re]:Se,[le]:Oe,[H]:he,[se]:ve,[F]:Ee},configs:{"recommended-alphabetical":X({type:u.alphabetical,order:m.asc,"ignore-case":!1}),"recommended-natural":X({type:u.natural,order:m.asc,"ignore-case":!1}),"recommended-line-length":X({type:u["line-length"],order:m.desc})},name:Me};module.exports=Le; |
{ | ||
"name": "eslint-plugin-perfectionist", | ||
"description": "ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"homepage": "https://eslint-plugin-perfectionist.azat.io", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/azat-io/eslint-plugin-perfectionist", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120565
2511