Ignoring multi line comments
Nishant-Pall opened this issue · 0 comments
Nishant-Pall commented
Is there a way to make prettier ignore commented lines inside the file that's supposed to be formatted?
I noticed this when I commented a whole function, and once I execute :Prettier
, Prettier stripped out the indentation and basically pushed all of the lines above each other with no spaces to the left. Something like this.
Before calling :Prettier
//const reducer = (state = initialState, action) => {
//switch (action.type) {
//case BUY_CAKE:
//return {
//...state,
//numOfCakes: state.numOfCakes - 1,
//};
//case BUY_ICECREAM:
//return {
//...state,
//numOfIceCreams: state.numOfIceCreams - 1,
//};
//default:
//return state;
//}
//};
and after calling :Prettier
//const reducer = (state = initialState, action) => {
//switch (action.type) {
//case BUY_CAKE:
//return {
//...state,
//numOfCakes: state.numOfCakes - 1,
//};
//case BUY_ICECREAM:
//return {
//...state,
//numOfIceCreams: state.numOfIceCreams - 1,
//};
//default:
//return state;
//}
//};
It does work in vscode, but apparently doesnt in neovim