Files
test-repo/tests/integration/plugins/preprocess/plugin.cjs
T

25 lines
418 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,
},
},
};