Skip to content

Commit a31c7db

Browse files
requireDictionaryWords: Sort words so binary search works
1 parent fbeb641 commit a31c7db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/rules/require-dictionary-words.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ module.exports.prototype = {
248248
'requireDictionaryWords.' + option + ' option requires ' +
249249
'an array value or should be removed'
250250
);
251+
// In order for binary searches to work the array must be
252+
// sorted.
253+
return value.sort();
251254
}
252255
return value;
253256
}

0 commit comments

Comments
 (0)