Open oscaramos opened 3 years ago
Hey, @oscaramos are there any updates on this?
I have made a fork for this in my own org if anyone has an opinion on how they would want this added I can probably come up with something
I think a flag in prettier config would be best IMO
module.exports = {
...
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderSortByLength": "asc" | "desc"
}
Looking forward to this feature
You can use eslint-plugin-perfectionist with fix on save option
any updates here?
I am using plugin:perfectionist/recommended-line-length and I would like to be sorted "asc" not "desc", I don't want to go through each rule and overwrite that. Is there any option available to change the sort order?
Thanks D
I am using plugin:perfectionist/recommended-line-length and I would like to be sorted "asc" not "desc"
@dannypk You can set up the plugin to sort in ascending or descending order. By default it sorts in desc.
module.exports = {
rules: {
'perfectionist/sort-imports': [
'error',
{
'groups': [
'side-effect',
['side-effect-style', 'style'],
['builtin-type', 'type', 'builtin', 'external', 'unknown'],
[
'internal-type',
'parent-type',
'sibling-type',
'index-type',
'internal',
'parent',
'sibling',
'index'
],
['object']
],
'newlines-between': 'always',
+ 'order': 'asc',
'type': 'line-length'
}
],
},
}
Hello,
Add an option to sort imports by line length. For example:
Sort by line length in ascending order:
Sort by line length in descending order: