I'm using Prettier in VSCode, but it appears to be flagging mistakes that I think are ok.
Specifically, if I test a variable like:
if (myObject?.property1?.property2) {
....
}
(Not sure of the correct name for using questions marks like this) then it flags the question marks as invalid.
I can see there is an ecmaVersion
setting in .prettierrc
but this doesn't seem to do anything, and anyway, as I understand it, Node versions don't exactly follow ECMA versions anyway.
What can I do to make Prettier correctly lint my code?