sunjw / jstoolnpp

A JavaScript (JSON) tool for Notepad++ (formerly JSMinNpp) and Visual Studio Code.
GNU General Public License v2.0
284 stars 24 forks source link

Optional Chaining Wrongly Formatted. #108

Closed bhavya32 closed 3 years ago

bhavya32 commented 3 years ago

Sample Code -

const adventurer = {
 dog: {
    name: 'cat1'
  }
};

const dogName = adventurer.dog?.name;
console.log(dogName);

If I apply JSFormat in NPP which is an excellent plugin btw :), I formats it the wrong way.

Adds unwanted spaces in - const dogName = adventurer.dog ? .name; Causing error as there should me no spaces in optional chaining. @sunjw Please see if you can fix this whenever you are free.

sunjw commented 3 years ago

Thanks for reporting this. I'll find time to fix.

sunjw commented 3 years ago

Fixed after 1e6e69a2b844dd0d8b4982d592a30ee26fe180de.

bhavya32 commented 3 years ago

Thank you. Appreciate your time.