Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Mar 31, 2022
1 parent 59cb140 commit 31ae5f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/docusaurus-mdx-loader/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ export default async function mdxLoader(

let result: string;
try {
result = (
await compiler.process({
result = await compiler
.process({
contents: content,
path: this.resourcePath,
})
).toString();
.then((res) => res.toString());
} catch (err) {
return callback(err as Error);
}
Expand Down
9 changes: 4 additions & 5 deletions packages/docusaurus-remark-plugin-npm2yarn/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import type {Code, Content, Literal} from 'mdast';
import type {Plugin, Transformer} from 'unified';
import type {Plugin} from 'unified';
import type {Node, Parent} from 'unist';
import visit from 'unist-util-visit';
import npmToYarn from 'npm-to-yarn';
Expand Down Expand Up @@ -61,9 +61,9 @@ const nodeForImport: Literal = {

const plugin: Plugin<[PluginOptions?]> = (options = {}) => {
const {sync = false} = options;
let transformed = false;
let alreadyImported = false;
const transformer: Transformer = (root) => {
return (root) => {
let transformed = false;
let alreadyImported = false;
visit(root, (node: Node) => {
if (isImport(node) && node.value.includes('@theme/Tabs')) {
alreadyImported = true;
Expand All @@ -87,7 +87,6 @@ const plugin: Plugin<[PluginOptions?]> = (options = {}) => {
(root as Parent).children.unshift(nodeForImport);
}
};
return transformer;
};

// To continue supporting `require('npm2yarn')` without the `.default` ㄟ(▔,▔)ㄏ
Expand Down

0 comments on commit 31ae5f1

Please sign in to comment.