Thanks for the great package, really useful for organizing larger files. I had an issue when sorting functions and const declarations, where any line with more than a single character gets sorted with the rest of its siblings.
Example:
export const createAddTrainersError = error => ({
type: ADD_TRAINERS_ERROR,
payload: error
});
function _updateUser(user) {
return {
type: UPDATE_USER,
payload: user
};
}
export const toggleModal = () => (dispatch) => {
dispatch({
type: ADD_TRAINER_TOGGLE_MODAL
});
};
will be reformatted to:
export const createAddTrainersError = error => ({
type: ADD_TRAINERS_ERROR,
payload: error
export const toggleModal = () => (dispatch) => {
dispatch({
type: ADD_TRAINER_TOGGLE_MODAL
});
function _updateUser(user) {
return {
type: UPDATE_USER,
payload: user
};
}
});
};
My somewhat messy solution was to change line 95 in the getTextBlocks function to:
if (line.trim().length === 1 || line[0] === '}' || line[0] === ')') {
Not sure what the most elegant way to handle something like this is. Happy to submit a PR if you are open to it or look into adding a keybinding that allows for this sort of thing.
Thanks for the great package, really useful for organizing larger files. I had an issue when sorting functions and const declarations, where any line with more than a single character gets sorted with the rest of its siblings.
Example:
will be reformatted to:
My somewhat messy solution was to change line 95 in the
getTextBlocksfunction to:if (line.trim().length === 1 || line[0] === '}' || line[0] === ')') {Not sure what the most elegant way to handle something like this is. Happy to submit a PR if you are open to it or look into adding a keybinding that allows for this sort of thing.