Prettier 1.11.1
Playground link
Input:
/** @type {Object} */(myObject.property).someProp = true;
(/** @type {Object} */(myObject.property)).someProp = true;
const prop = /** @type {Object} */(myObject.property).someProp;
Output:
/** @type {Object} */ myObject.property.someProp = true;
/** @type {Object} */ (myObject.property).someProp = true;
const prop = /** @type {Object} */ (myObject.property.someProp);
Second Output:
/** @type {Object} */ myObject.property.someProp = true;
/** @type {Object} */ myObject.property.someProp = true;
const prop = /** @type {Object} */ (myObject.property.someProp);
Expected behavior:
The parentheses should be kept as per #2484
Also I would expect the prettier output not to be different for consecutive parsings. Now the second line of the input above gets rewritten to the first one and eventually without parentheses at all.
In the last case of the output above, the parentheses are maintained, but the closing one is moved to the back.
Prettier 1.11.1
Playground link
Input:
Output:
Second Output:
Expected behavior:
The parentheses should be kept as per #2484
Also I would expect the prettier output not to be different for consecutive parsings. Now the second line of the input above gets rewritten to the first one and eventually without parentheses at all.
In the last case of the output above, the parentheses are maintained, but the closing one is moved to the back.