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

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

41 lines
756 B
JavaScript
Raw Normal View History

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