-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Even though the sorting is respecting the groups on objects, but on the destructured objects, it doesn't respect that
the rule config:
"perfectionist/sort-objects": [
"error",
{
type: "line-length",
order: "asc",
fallbackSort: { type: "natural", order: "asc" },
partitionByNewLine: true,
groups: [
"property",
"multiline-property",
"method",
"multiline-method",
"unknown",
],
destructuredObjects: { groups: true },
},
],
Code example
what it should acts:
const sampleObject = {
property1: "value1",
property2: "value2",
method1: () => "result1",
method2: () => "result2",
};
const { property1, property2, method1, method2 } = sampleObject;
but the actuall result is:
const sampleObject = {
property1: "value1",
property2: "value2",
method1: () => "result1",
method2: () => "result2",
};
const { method1, method2, property1, property2 } = sampleObject;
ESLint version
8.57.1
ESLint Plugin Perfectionist version
4.13.0
Additional comments
No response
Validations
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working