prettier/tests/comments/closure-compiler-type-cast.js

17 lines
502 B
JavaScript

// test to make sure comments are attached correctly
let inlineComment = /* some comment */ (
someReallyLongFunctionCall(withLots, ofArguments));
let object = {
key: /* some comment */ (someReallyLongFunctionCall(withLots, ofArguments))
};
// preserve parens only for type casts
let assignment = /** @type {string} */ (getValue());
functionCall(1 + /** @type {string} */ (value), /** @type {!Foo} */ ({}));
function returnValue() {
return /** @type {!Array.<string>} */ (['hello', 'you']);
}