refactor: Remove unused 'path' property in Section type

This commit is contained in:
Gauthier Daniels 2025-04-20 00:35:09 +02:00
parent 2e692f7264
commit 29a2246ef3
2 changed files with 0 additions and 20 deletions

View File

@ -2,5 +2,4 @@ export type Section = {
id: string; id: string;
title: string; title: string;
level: 2 | 3; level: 2 | 3;
path: string;
}; };

View File

@ -124,21 +124,6 @@ const formatExportNode = (): MDXJSEsm => {
method: false, method: false,
shorthand: false, shorthand: false,
}, },
{
type: "Property",
key: {
type: "Identifier",
name: "path",
},
value: {
type: "Literal",
value: section.path,
},
kind: "init",
computed: false,
method: false,
shorthand: false,
},
], ],
})), })),
}, },
@ -161,9 +146,6 @@ const remarkHeadingId: Plugin<[], Root> = () => (tree: Root, file) => {
visit(tree, "heading", (node) => { visit(tree, "heading", (node) => {
const lastChild = node.children[node.children.length - 1]; const lastChild = node.children[node.children.length - 1];
const filePath = file.path;
console.log(`File path: ${filePath}`);
if (lastChild && lastChild.type === "text") { if (lastChild && lastChild.type === "text") {
const string = lastChild.value.replace(/ +$/, ""); const string = lastChild.value.replace(/ +$/, "");
const matched = string.match(/ {#(.*?)}$/); const matched = string.match(/ {#(.*?)}$/);
@ -181,7 +163,6 @@ const remarkHeadingId: Plugin<[], Root> = () => (tree: Root, file) => {
id: slug, id: slug,
title: extractText(node.children), title: extractText(node.children),
level: depth, level: depth,
path: filePath,
}); });
}); });