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

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

31 lines
556 B
JavaScript
Raw Normal View History

"use strict";
module.exports = {
languages: [
{
name: "foo",
parsers: ["foo-parser"],
extensions: [".foo"],
2022-07-20 23:18:24 +08:00
since: "1.0.0",
},
],
options: {
fooString: {
type: "string",
default: "bar",
2022-07-20 23:18:24 +08:00
description: "foo description",
},
},
parsers: {
"foo-parser": {
2022-07-20 23:18:24 +08:00
parse: (text) => ({ text }),
astFormat: "foo-ast",
},
},
printers: {
"foo-ast": {
print: (path, options) =>
2022-07-20 23:18:24 +08:00
options.fooString ? `foo:${options.fooString}` : path.getValue().text,
},
},
};