Skip to content

Commit

Permalink
Update lint.js
Browse files Browse the repository at this point in the history
  • Loading branch information
gap579137 committed Sep 20, 2024
1 parent e1b3424 commit dd42b8b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions scripts/lint.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
const fs = require("fs").promises;
const path = require("path");
const fs = require("node:fs").promises;
const path = require("node:path");

(async () => {
let hasError = false;
const hasError = false;

try {
const directoryPath = path.join(__dirname, "..");
const files = (await fs.readdir(directoryPath)).filter(file => file.endsWith(".txt") && file !== "everything.txt");
const files = (await fs.readdir(directoryPath)).filter(
(file) => file.endsWith(".txt") && file !== "everything.txt",
);

await Promise.all(files.map(async file => {
const filePath = path.join(directoryPath, file);
const fileContents = await fs.readFile(filePath, "utf8");
await Promise.all(
files.map(async (file) => {
const filePath = path.join(directoryPath, file);
const fileContents = await fs.readFile(filePath, "utf8");
const lines = fileContents.split("\n");
const commentedURLs = lines
.filter((line) => line.startsWith("# 0.0.0.0"))
.map((line) => line.split(" ")[2].trim());

const lines = fileContents.split("\n");
const commentedURLs = lines
.filter(line => line.startsWith("# 0.0.0.0"))
.map(line => line.split(" ")[2].trim());

let isHeaderComplete = false;
let isHeaderComplete = false;

lines.forEach((line, index) => {
// Mark the end of the header section
Expand Down Expand Up @@ -78,6 +80,7 @@ const path = require("path");
});
}));


process.exit(hasError ? 1 : 0);
} catch (error) {
console.error("An error occurred during file processing:", error);
Expand Down

0 comments on commit dd42b8b

Please sign in to comment.