-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TypeScript 3.7] add support for nullish coalescing operator #6609
Comments
This one comes along with Optional Chaining #6595. I wanted to be sure that this one is not overlooked. |
I've updated Prettier to 1.19.0, but I'm still getting errors when formatting files containing nullish coalescing statements.
|
@vernondegoede Your example seems to work: Prettier 1.19.0 --parser typescript Input: const MethodIcon: React.FC<Props> = ({ method, size = "default" }) => {
const methodIcon = PAYMENT_METHOD_IMAGES[method] ?? require("assets/images/payment-methods/unknown.png");
} Output: const MethodIcon: React.FC<Props> = ({ method, size = "default" }) => {
const methodIcon =
PAYMENT_METHOD_IMAGES[method] ??
require("assets/images/payment-methods/unknown.png");
}; Please open a new issue if you find a bug. First, triple-check that the Prettier that is running actually is the version you think it is. |
Prettier 1.18.2
Input:
Output:
Expected behavior:
Should understand or at least ignore such expression.
The text was updated successfully, but these errors were encountered: