For example if we have this in a .ts file:
export const handleHMRMessages = (cache: any, store: CPReduxStore, conn: WebSocket) => {
conn.onclose = () => {
store.dispatch(actions.dev.hmrDisconnected());
};
}
prettier will remove all carriage returns above the first line of code in the func body:
export const handleHMRMessages = (cache: any, store: CPReduxStore, conn: WebSocket) => {
conn.onclose = () => {
store.dispatch(actions.dev.hmrDisconnected());
};
}
so I have been resorting to adding a comment above the declaration to preserve the space:
export const handleHMRMessages = (cache: any, store: CPReduxStore, conn: WebSocket) => {
// add comment here as needed
conn.onclose = () => {
store.dispatch(actions.dev.hmrDisconnected());
};
}
is there a prettier setting that can always have no more and no less space below a function declaration?