eslint-plugin-perfectionist
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -98,4 +98,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(element.range), | ||
node: structuredClone(element), | ||
type: element.type, | ||
node: element, | ||
group, | ||
@@ -102,0 +102,0 @@ }) |
@@ -135,4 +135,4 @@ 'use strict' | ||
accumulator.at(-1).push({ | ||
node: structuredClone(attribute), | ||
size: rangeToDiff.rangeToDiff(attribute.range), | ||
node: attribute, | ||
group: getGroup(), | ||
@@ -139,0 +139,0 @@ name, |
@@ -307,4 +307,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(member.range), | ||
node: structuredClone(member), | ||
group: getGroup(), | ||
node: member, | ||
dependencies, | ||
@@ -311,0 +311,0 @@ name, |
@@ -78,6 +78,12 @@ 'use strict' | ||
TSEnumDeclaration: node => { | ||
let getMembers = nodeValue => | ||
/* v8 ignore next 2 */ | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
node.body.members || nodeValue.members | ||
let getMembers = nodeValue => { | ||
var _a | ||
return ( | ||
/* v8 ignore next 2 */ | ||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
((_a = node.body) == null ? void 0 : _a.members) ?? | ||
nodeValue.members ?? | ||
[] | ||
) | ||
} | ||
if ( | ||
@@ -114,3 +120,3 @@ getMembers(node).length > 1 && | ||
size: rangeToDiff.rangeToDiff(member.range), | ||
node: structuredClone(member), | ||
node: member, | ||
name, | ||
@@ -117,0 +123,0 @@ } |
@@ -64,4 +64,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(node.range), | ||
node: structuredClone(node), | ||
name: node.source.value, | ||
node, | ||
}) | ||
@@ -68,0 +68,0 @@ } |
@@ -346,4 +346,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(node.range), | ||
node: structuredClone(node), | ||
group: computeGroup(node), | ||
node, | ||
name, | ||
@@ -350,0 +350,0 @@ ...(options.type === 'line-length' && |
@@ -179,3 +179,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(element.range), | ||
node: structuredClone(element), | ||
node: element, | ||
name, | ||
@@ -182,0 +182,0 @@ } |
@@ -148,4 +148,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(type.range), | ||
node: structuredClone(type), | ||
group: getGroup(), | ||
node: type, | ||
} | ||
@@ -152,0 +152,0 @@ }) |
@@ -144,4 +144,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(attribute.range), | ||
node: structuredClone(attribute), | ||
group: getGroup(), | ||
node: attribute, | ||
name, | ||
@@ -148,0 +148,0 @@ } |
@@ -102,3 +102,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(element.range), | ||
node: structuredClone(element), | ||
node: element, | ||
name, | ||
@@ -105,0 +105,0 @@ } |
@@ -81,4 +81,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(specifier.range), | ||
node: structuredClone(specifier), | ||
name: specifier.local.name, | ||
node: specifier, | ||
group, | ||
@@ -85,0 +85,0 @@ } |
@@ -97,3 +97,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(specifier.range), | ||
node: structuredClone(specifier), | ||
node: specifier, | ||
group, | ||
@@ -100,0 +100,0 @@ name, |
@@ -167,3 +167,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(member.range) - endSize, | ||
node: structuredClone(member), | ||
node: member, | ||
name, | ||
@@ -170,0 +170,0 @@ } |
@@ -255,3 +255,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(prop.range), | ||
node: structuredClone(prop), | ||
node: prop, | ||
name, | ||
@@ -258,0 +258,0 @@ } |
@@ -142,3 +142,3 @@ 'use strict' | ||
accumulator.at(-1).push({ | ||
node: structuredClone(attribute), | ||
node: attribute, | ||
size: rangeToDiff.rangeToDiff(attribute.range), | ||
@@ -145,0 +145,0 @@ group: getGroup(), |
@@ -91,3 +91,3 @@ 'use strict' | ||
), | ||
node: structuredClone(caseNode), | ||
node: caseNode, | ||
name, | ||
@@ -146,3 +146,3 @@ } | ||
let additionalFixes = [] | ||
let nodeGroups = structuredClone(nodes).reduce( | ||
let nodeGroups = nodes.reduce( | ||
(accumulator, currentNode, index) => { | ||
@@ -168,6 +168,16 @@ var _a | ||
var _a, _b | ||
let sortedGroup = sortNodes.sortNodes(group, options) | ||
let sortedGroup = sortNodes | ||
.sortNodes(group, options) | ||
.sort((a, b) => { | ||
if (b.name === 'default') { | ||
return -1 | ||
} | ||
return 1 | ||
}) | ||
if (group.at(-1).name !== sortedGroup.at(-1).name) { | ||
let consequentNodeIndex = sortedGroup.findIndex( | ||
currentNode => currentNode.node.consequent.length !== 0, | ||
) | ||
let firstSortedNodeConsequent = | ||
sortedGroup.at(0).node.consequent | ||
sortedGroup.at(consequentNodeIndex).node.consequent | ||
let consequentStart = | ||
@@ -174,0 +184,0 @@ (_a = firstSortedNodeConsequent.at(0)) == null |
@@ -148,4 +148,4 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(type.range), | ||
node: structuredClone(type), | ||
group: getGroup(), | ||
node: type, | ||
} | ||
@@ -152,0 +152,0 @@ }) |
@@ -114,3 +114,3 @@ 'use strict' | ||
size: rangeToDiff.rangeToDiff(declaration.range), | ||
node: structuredClone(declaration), | ||
node: declaration, | ||
dependencies, | ||
@@ -117,0 +117,0 @@ name, |
@@ -141,3 +141,3 @@ 'use strict' | ||
accumulator.at(-1).push({ | ||
node: structuredClone(attribute), | ||
node: attribute, | ||
size: rangeToDiff.rangeToDiff(attribute.range), | ||
@@ -144,0 +144,0 @@ group: getGroup(), |
{ | ||
"name": "eslint-plugin-perfectionist", | ||
"description": "ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"homepage": "https://perfectionist.dev", | ||
@@ -6,0 +6,0 @@ "repository": "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
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
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
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
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
336030
9780