Skip to content

Latest commit

 

History

History
82 lines (58 loc) · 1.87 KB

CHANGELOG.unreleased.md

File metadata and controls

82 lines (58 loc) · 1.87 KB
  • JavaScript: Fix closure compiler typecasts ([#5947] by [@jridgewell])

    If a closing parenthesis follows after a typecast in an inner expression, the typecast would wrap everything to the that following parenthesis.

    // Input
    test(/** @type {!Array} */(arrOrString).length);
    test(/** @type {!Array} */((arrOrString)).length + 1);
    
    // Output (Prettier stable)
    test(/** @type {!Array} */ (arrOrString.length));
    test(/** @type {!Array} */ (arrOrString.length + 1));
    
    // Output (Prettier master)
    test(/** @type {!Array} */ (arrOrString).length);
    test(/** @type {!Array} */ (arrOrString).length + 1);
  • JavaScript: respect parenthesis around optional chaining before await ([#6087] by [@evilebottnawi])

    // Input
    async function myFunction() {
      var x = (await foo.bar.blah)?.hi;
    }
    
    // Output (Prettier stable)
    async function myFunction() {
      var x = await foo.bar.blah?.hi;
    }
    
    // Output (Prettier master)
    async function myFunction() {
      var x = (await foo.bar.blah)?.hi;
    }