eslint-plugin-sort-exports
eslint-plugin-sort-exports copied to clipboard
Selectively enable export member sort
It would be cool to have an option to selectively only enable export member sorting, without export declarations being sorted as well.
Similar to the sort-import
setting:
"sort-imports": [
"error",
{
"ignoreCase": true,
"ignoreDeclarationSort": true,
"ignoreMemberSort": false
}
],
so that only export {b, a, c} from 'foo'
will be sorted to export {a, b, c} from 'foo'
.
Why Imagine having some declarative single const exports:
export const b = 'someValue';
export const a = b + 'Addition';
being sorted to:
export const a = b + 'Addition';
export const b = 'someValue';
this will cause an ReferenceError: Cannot access 'b' before initialization
Error.