Temporary fix comments inside of flow type spread (#1716)
This is breaking on fb code. While benjamn/ast-types#221 is getting merged in ast-type, we can add it in prettier so it fixes the issue. Fixes #1632master
parent
71a39d2512
commit
a6068c0532
|
@ -8,6 +8,13 @@ module.exports = function(fork) {
|
|||
const or = types.Type.or;
|
||||
const defaults = fork.use(require("ast-types/lib/shared")).defaults;
|
||||
|
||||
// Putting it here while it's being merged upstream
|
||||
// https://github.com/benjamn/ast-types/pull/221
|
||||
def("ObjectTypeSpreadProperty")
|
||||
.bases("Node")
|
||||
.build("argument")
|
||||
.field("argument", def("Type"));
|
||||
|
||||
// Ambient
|
||||
def("TSAmbientVariableDefinition").bases("VariableDeclaration");
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`comments.js 1`] = `
|
||||
type X = {...Y/**/};
|
||||
type X = {/**/...Y};
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type X = { ...Y /**/ };
|
||||
type X = { /**/ ...Y };
|
||||
|
||||
`;
|
|
@ -0,0 +1,2 @@
|
|||
type X = {...Y/**/};
|
||||
type X = {/**/...Y};
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname, null, ["babylon"]);
|
Loading…
Reference in New Issue