Skip to content

Commit

Permalink
fixup! Alphabetize imports within groups
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanbeevers committed May 18, 2018
1 parent aff7e4e commit 707f937
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rules/order.js
Expand Up @@ -222,7 +222,7 @@ function mutateRanksToAlphabetize(imported) {

// Create the unsorted lists of imports
const importedItemNamesByRank = imported.reduce(function (acc, importedItem) {
acc[importedItem.rank] = (acc[importedItem.rank] || [])
acc[importedItem.rank] = acc[importedItem.rank] || []
acc[importedItem.rank].push(importedItem.name)
return acc
}, {})
Expand Down Expand Up @@ -423,7 +423,10 @@ module.exports = {
},
alphabetize: {
type: 'boolean',
}
'description':
'If `true`, imports are be expected to be sorted alphabetically within groups',
'default': false,
},
},
additionalProperties: false,
},
Expand Down

0 comments on commit 707f937

Please sign in to comment.