Skip to content

Commit

Permalink
chore: move switch plugin to src
Browse files Browse the repository at this point in the history
  • Loading branch information
rellafella committed Apr 10, 2024
1 parent fb780ae commit 98f2993
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const prettier = require("prettier");
import prettier from "prettier";
const { indent, hardline } = prettier.doc.builders;
const {
import {
STRING_NEEDS_QUOTES,
printSingleTwigTag,
indentWithHardline,
isEmptySequence
} = require("../../src/util");
const { Node } = require("melody-types");
} from "../../util/index.js";
import { Node } from "melody-types";

const printSwitch = (node, path, print) => {
node[STRING_NEEDS_QUOTES] = true;
Expand All @@ -30,8 +30,6 @@ const printSwitch = (node, path, print) => {
return parts;
};

module.exports = {
printers: {
switchTag: printSwitch
}
export const printers = {
switchTag: printSwitch
};
2 changes: 1 addition & 1 deletion tests/GenericTagCustomPrint/jsfmt.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run_spec(__dirname, ["melody"], {
twigMultiTags: ["switch,case,default,endswitch"],
twigMelodyPlugins: ["tests/switch-plugin"]
twigMelodyPlugins: ["plugins/switch-plugin/index.js"]
});

0 comments on commit 98f2993

Please sign in to comment.