Skip to content

Commit

Permalink
Make output look better
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Nov 12, 2021
1 parent 075b4de commit b894444
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`npm2yarn plugin test: already imported tabs components above are not re
import TabItem from '@theme/TabItem';
<Tabs >
<Tabs>
<TabItem value=\\"npm\\">
\`\`\`bash
Expand All @@ -25,7 +25,7 @@ import TabItem from '@theme/TabItem';
`;
exports[`npm2yarn plugin test: already imported tabs components below are not re-imported 1`] = `
"<Tabs >
"<Tabs>
<TabItem value=\\"npm\\">
\`\`\`bash
Expand All @@ -52,7 +52,7 @@ exports[`npm2yarn plugin test: installation file 1`] = `
"import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<Tabs >
<Tabs>
<TabItem value=\\"npm\\">
\`\`\`bash
Expand Down Expand Up @@ -94,7 +94,7 @@ import TabItem from '@theme/TabItem';
A plugin is usually a npm package, so you install them like other npm packages using npm.
<Tabs >
<Tabs>
<TabItem value=\\"npm\\">
\`\`\`bash
Expand Down
4 changes: 2 additions & 2 deletions packages/docusaurus-remark-plugin-npm2yarn/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ interface PluginOptions {
const convertNpmToYarn = (npmCode: string) => npmToYarn(npmCode, 'yarn');

const transformNode = (node: Code, isSync: boolean) => {
const groupIdProp = isSync ? 'groupId="npm2yarn" ' : '';
const groupIdProp = isSync ? ' groupId="npm2yarn"' : '';
const npmCode = node.value;
const yarnCode = convertNpmToYarn(node.value);
return [
{
type: 'jsx',
value: `<Tabs ${groupIdProp}>\n<TabItem value="npm">`,
value: `<Tabs${groupIdProp}>\n<TabItem value="npm">`,
},
{
type: node.type,
Expand Down

0 comments on commit b894444

Please sign in to comment.