Files
test-repo/tests/config/utils/create-plugin.cjs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
514 B
JavaScript
Raw Normal View History

"use strict";
function createPlugin({ name, print, finalNewLine = true }) {
return {
languages: [
{
name,
parsers: [name],
extensions: [`.${name}`],
},
],
parsers: {
[name]: {
parse: (text) => ({ value: text }),
astFormat: name,
},
},
printers: {
[name]: {
print(path) {
return print(path.getValue().value) + (finalNewLine ? "\n" : "");
},
},
},
};
}
module.exports = createPlugin;