Feature Request Checklist
Overview
The current implementation could be extended to support sorting the objects within an array with wildcard patterns (e.g., <array-key>.*). For example, it could then sort the properties of each object in the contributors array. Using a pattern similar to the current key/order pattern to express this:
'package-json/sort-collections': ['warn', [
{
key: 'contributors.*',
order: ['name', 'email', 'url'],
},
]],
Input:
{
"contributors": [
{
"url": "https://example.com/bob",
"name": "Bob",
"email": "bob@example.com"
},
{
"email": "alice@example.com",
"name": "Alice"
}
]
}
Output:
{
"contributors": [
{
"name": "Bob",
"email": "bob@example.com",
"url": "https://example.com/bob"
},
{
"name": "Alice",
"email": "alice@example.com"
}
]
}
Additional Info
No response
Feature Request Checklist
Overview
The current implementation could be extended to support sorting the objects within an array with wildcard patterns (e.g.,
<array-key>.*). For example, it could then sort the properties of each object in thecontributorsarray. Using a pattern similar to the current key/order pattern to express this:Input:
Output:
Additional Info
No response