prettier/tests_integration/plugins/extensions/plugin.js

26 lines
438 B
JavaScript

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