Skip to content

Commit 1946455

Browse files
Fix lint errors
1 parent d1895a4 commit 1946455

File tree

3 files changed

+9
-97
lines changed

3 files changed

+9
-97
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"lint:code": "eslint .",
4242
"lint:code:fix": "eslint . --fix",
4343
"postinstall": "patch-package",
44-
"postbuild": "node ./scripts/joinLlmsFiles.mjs && node ./scripts/cleanupMarkdownFiles.mjs"
44+
"postbuild": "node ./scripts/joinLlmsFiles.mjs"
4545
},
4646
"devDependencies": {
4747
"@apify/eslint-config": "^1.0.0",

scripts/cleanupMarkdownFiles.mjs

Lines changed: 0 additions & 90 deletions
This file was deleted.

tools/utils/removeLlmButtons.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@ function removeLlmButtons() {
1010
// Remove text nodes that contain LLM button text
1111
visit(tree, 'text', (node, index, parent) => {
1212
if (node.value && (
13-
node.value.includes('View as Markdown') ||
14-
node.value.includes('Copy for LLM') ||
15-
node.value.includes('View as MarkdownCopy for LLM') ||
16-
node.value.trim() === 'View as Markdown' ||
17-
node.value.trim() === 'Copy for LLM'
13+
node.value.includes('View as Markdown')
14+
|| node.value.includes('Copy for LLM')
15+
|| node.value.includes('View as MarkdownCopy for LLM')
16+
|| node.value.trim() === 'View as Markdown'
17+
|| node.value.trim() === 'Copy for LLM'
1818
)) {
1919
// Remove the text node
2020
parent.children.splice(index, 1);
2121
return index; // Adjust index after removal
2222
}
23+
return undefined; // Explicit return for consistency
2324
});
2425

2526
// Clean up empty paragraphs that resulted from text removal
2627
visit(tree, 'paragraph', (node, index, parent) => {
2728
// Check if paragraph is empty or only contains whitespace
28-
const hasContent = node.children && node.children.some(child => {
29+
const hasContent = node.children && node.children.some((child) => {
2930
if (child.type === 'text') {
3031
return child.value && child.value.trim().length > 0;
3132
}
@@ -37,6 +38,7 @@ function removeLlmButtons() {
3738
parent.children.splice(index, 1);
3839
return index;
3940
}
41+
return undefined; // Explicit return for consistency
4042
});
4143
};
4244
}

0 commit comments

Comments
 (0)