Open sardor01 opened 4 days ago
Currently, you can use ESLint comments to define plugin rule settings.
/*
eslint perfectionist/sort-objects: [
'error',
{
type: 'alphabetical',
order: 'asc',
partitionByNewLine: true
}
]
*/
Using annotations looks beautiful and convenient. But I'm not sure it will be in demand.
I would like to hear more opinions from other users.
I understand the use case for sort-array-includes
: it would allow users to sort arrays
who do not have .include
if the user wishes.
However, I'm not sure to understand the use case with other rules such as sort-objects
: all objects get sorted if the rule is active, why would an annotation be needed?
@sardor01 Perhaps the ESLint comment solves your problem?
Describe the rule
There is existing package that implements similar feature: https://github.com/ronparkdev/eslint-plugin-annotation
I personally think it would be great if
eslint-plugin-perfectionist
provided thie rule since it's also related to sorting.Code example
| | |
Additional comments
No response
Validations