Skip to content

Commit

Permalink
refactor: fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Oct 4, 2023
1 parent bb5e750 commit 1c2eb07
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-breaks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import remarkBreaks from 'remark-breaks'

export default function breaks(): HashmdPlugin {
return {
remark: (processor) => processor.use(remarkBreaks),
remark: (processor) => processor.use<any, any>(remarkBreaks),
}
}
2 changes: 1 addition & 1 deletion packages/plugin-frontmatter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function frontmatter({
return {
remark: (processor) =>
// @ts-ignore
processor.use(remarkFrontmatter).use(() => (tree, file) => {
processor.use(remarkFrontmatter).use<any, any>(() => (tree, file) => {
// TODO: arg types
// console.log(tree);
const fisrtNode = tree.children[0]
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-gemoji/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import remarkGemoji from 'remark-gemoji'

export default function gemoji(): HashmdPlugin {
return {
remark: (processor) => processor.use(remarkGemoji),
remark: (processor) => processor.use<any, any>(remarkGemoji),
}
}
8 changes: 2 additions & 6 deletions packages/plugin-highlight-ssr/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type { HashmdPlugin } from 'hashmd'
import rehypeHighlight, { Options } from 'rehype-highlight'

export default function highlightSsr({
ignoreMissing = true,
...rest
}: Options = {}): HashmdPlugin {
export default function highlightSsr(options: Options = {}): HashmdPlugin {
return {
rehype: (processor) =>
processor.use(rehypeHighlight, { ignoreMissing, ...rest }),
rehype: (processor) => processor.use<any, any>(rehypeHighlight, options),
}
}
2 changes: 1 addition & 1 deletion packages/plugin-math-ssr/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function mathSsr({
const locale = { ...en, ..._locale }
return {
remark: (processor) => processor.use(remarkMath),
rehype: (processor) => processor.use(rehypeKatex, katexOptions),
rehype: (processor) => processor.use<any, any>(rehypeKatex, katexOptions),
actions: getMathActions(locale),
}
}

0 comments on commit 1c2eb07

Please sign in to comment.