Prettier VSCode plugin is failing on new TypeScript in version 3.7.2 syntax (specifically optional chaining). Prettier 1.19.1 was release on 11/8/2019 adding support https://github.com/prettier/prettier/issues/6469
x?.y to a TS fileOutput window of VSCode, and there will be an error of Expression expected pointing to the ?.No error should be thrown, and auto-format should succeed
See steps to reproduce
VS Code Version: 1.40.0
Prettier & Prettier Plugin Version: 1.19.1 and 2.3.0 respectively
OS and version: macOS 10.14.6
https://github.com/prettier/prettier-vscode/pull/1025 related. Just saw this automated PR is out but failing
As a note, v3.1.0 of the plugin (which is in preview) does successfully work with TS v3.7.2
Version 3.0 is now released to the normal extension location.
VSCode is still on 3.6.x, you need to force it to use the locally installed typescript in node_modules (to 3.7.2), see https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
VSCode is still on 3.6.x, you need to force it to use the locally installed typescript in node_modules (to 3.7.2), see https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions