This works as expected (the module.exports
thing stays untouched by prettier):
console.log('hi');
// prettier-ignore
module.exports = {
"foo": "bar",
};
But the following doesn't work (module.exports
is reformatted):
// Some comment stuff
// prettier-ignore
module.exports = {
"foo": "bar",
};
Here's a live reproduction. Thanks for reporting!
Looks like I only check for the first comment attached to a node. /facepalm
@vjeux Good thing you added "easy" :) #1125 is ready for review, since I had 10 minutes and didn't want to do _real_ work stuff.
Most helpful comment
https://github.com/prettier/prettier/blob/60816af4ce6df274b10f3f9cd264a78f1106c48b/src/printer.js#L68
Looks like I only check for the first comment attached to a node. /facepalm