Skip to content

Commit 85cd479

Browse files
AR10DevCopilot
andauthored
fix: resolve biome linting and astro check errors
- Fix import ordering in src/pages/blog/rss.xml.ts - Fix formatting and unused variable in validate-seo.js - Remove unused siteUrl variable (prefixed with underscore) - All pages pass astro check and biome lint Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 68f4b27 commit 85cd479

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/pages/blog/rss.xml.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import rss from "@astrojs/rss";
21
import { getCollection } from "astro:content";
2+
import rss from "@astrojs/rss";
33
import type { APIContext } from "astro";
44

55
export async function GET(context: APIContext) {
66
const siteUrl = "https://avaabrazzaq.com";
7-
7+
88
const blogPosts = await getCollection("blog", ({ data }) => {
99
return data.draft !== true;
1010
});
1111

1212
const sortedPosts = blogPosts.sort(
13-
(a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime()
13+
(a, b) => b.data.publishDate.getTime() - a.data.publishDate.getTime(),
1414
);
1515

1616
return rss({

validate-seo.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
* Validates that all pages have proper SEO elements
66
*/
77

8-
import { readFileSync, readdirSync, statSync } from "node:fs";
8+
import { readdirSync, readFileSync, statSync } from "node:fs";
99
import { join } from "node:path";
1010

1111
const distDir = "./dist";
12-
const siteUrl = "https://avaabrazzaq.com";
1312

1413
// Colors for console output
1514
const colors = {
@@ -43,7 +42,9 @@ function findHtmlFiles(dir, fileList = []) {
4342

4443
function validateHtmlFile(filePath) {
4544
const content = readFileSync(filePath, "utf-8");
46-
const relativePath = filePath.replace(distDir, "").replace("/index.html", "/");
45+
const relativePath = filePath
46+
.replace(distDir, "")
47+
.replace("/index.html", "/");
4748
const issues = [];
4849
const warnings = [];
4950

@@ -58,9 +59,7 @@ function validateHtmlFile(filePath) {
5859
}
5960

6061
// Check for meta description
61-
const descMatch = content.match(
62-
/<meta name="description" content="([^"]+)"/,
63-
);
62+
const descMatch = content.match(/<meta name="description" content="([^"]+)"/);
6463
if (!descMatch) {
6564
issues.push("Missing meta description");
6665
} else if (descMatch[1].length < 120 || descMatch[1].length > 160) {
@@ -256,13 +255,16 @@ function main() {
256255
}
257256

258257
// Summary
259-
log("\n" + "=".repeat(50), "blue");
258+
log(`\n${"=".repeat(50)}`, "blue");
260259
log("📊 Summary", "blue");
261260
log("=".repeat(50), "blue");
262261
log(`Total pages validated: ${htmlFiles.length}`, "blue");
263262
log(`Pages with issues: ${pagesWithIssues.length}`, "yellow");
264263
log(`Total issues: ${totalIssues}`, totalIssues > 0 ? "red" : "green");
265-
log(`Total warnings: ${totalWarnings}`, totalWarnings > 0 ? "yellow" : "green");
264+
log(
265+
`Total warnings: ${totalWarnings}`,
266+
totalWarnings > 0 ? "yellow" : "green",
267+
);
266268

267269
if (totalIssues === 0 && totalWarnings === 0) {
268270
log("\n✅ All pages pass SEO validation!", "green");

0 commit comments

Comments
 (0)