recommended-natural
Configuration for the eslint-plugin-perfectionist
plugin, which provides all plugin rules with predefined options: natural sorting in ascending order.
What is the difference between natural sorting and alphabetical sorting? Natural sort compares strings containing a mixture of letters and numbers, just as a human would do when sorting. For example: item-1
, item-2
, item-10
.
Read more about natural sort algorithm.
This configuration will allow you to navigate through your code faster because all the data that can be safely sorted will be in order.
When to Use
Use the recommended-natural configuration if you want elements in your code to be sorted in a way that feels more intuitive to humans.
This configuration is particularly useful in projects where an intuitive understanding of the order of elements is important, such as version files, task lists, or any other data sets that contain numerical values. Natural sorting makes your code more readable and easier to comprehend, especially in situations where numerical values play a key role.