Files
test-repo/tests_integration/plugins/flushLineSuffix/plugin.js
T
Dang Mai 9d06174d55 Fix #9702 - Flush line suffix contents at the end of document (#9703)
* Failing test case for flushing line-suffix contents

* Flush remaining line-suffix contents at the end of document
2020-11-18 12:58:46 +02:00

26 lines
443 B
JavaScript

"use strict";
const prettier = require("prettier-local");
const { lineSuffix } = prettier.doc.builders;
module.exports = {
languages: [
{
name: "foo",
parsers: ["foo-parser"],
extensions: [".foo"]
}
],
parsers: {
"foo-parser": {
parse: text => ({ text }),
astFormat: "foo-ast"
}
},
printers: {
"foo-ast": {
print: path => lineSuffix(path.getValue().text.trim())
}
}
};