prettier/tests_integration/plugins/preprocess/plugin.js

25 lines
405 B
JavaScript

"use strict";
module.exports = {
languages: [
{
name: "foo",
parsers: ["foo-parser"],
extensions: [".foo"],
since: "1.0.0"
}
],
parsers: {
"foo-parser": {
preprocess: text => `preprocessed:${text}`,
parse: text => ({ text }),
astFormat: "foo-ast"
}
},
printers: {
"foo-ast": {
print: path => path.getValue().text
}
}
};