From 707f9374e06024f84055846e122752a0e9d2dbf4 Mon Sep 17 00:00:00 2001 From: Duncan Beevers Date: Thu, 17 May 2018 23:20:26 -0700 Subject: [PATCH] fixup! Alphabetize imports within groups --- src/rules/order.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rules/order.js b/src/rules/order.js index 7c8a14f53..170091de6 100644 --- a/src/rules/order.js +++ b/src/rules/order.js @@ -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 }, {}) @@ -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, },