chore:little fixes and formating and linting and patches
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { readFile, readdir } from 'node:fs/promises';
|
||||
import { readdir, readFile } from 'node:fs/promises';
|
||||
import { join } from 'node:path';
|
||||
|
||||
interface FileStructure {
|
||||
@@ -10,7 +10,7 @@ interface FileStructure {
|
||||
}
|
||||
|
||||
async function analyzeJsonFiles(): Promise<void> {
|
||||
const dirPath = join(import.meta.dirname || __dirname);
|
||||
const dirPath = join(import.meta.dirname || import.meta.dirname);
|
||||
const files = await readdir(dirPath);
|
||||
const jsonFiles = files.filter((f) => f.endsWith('.json'));
|
||||
|
||||
@@ -88,7 +88,7 @@ async function analyzeJsonFiles(): Promise<void> {
|
||||
console.log(separator);
|
||||
|
||||
const sortedGroups = Array.from(groups.entries()).sort(
|
||||
(a, b) => b[1].length - a[1].length,
|
||||
(a, b) => b[1].length - a[1].length
|
||||
);
|
||||
|
||||
sortedGroups.forEach(([structureKey, files], index) => {
|
||||
@@ -117,7 +117,7 @@ async function analyzeJsonFiles(): Promise<void> {
|
||||
console.log(separator);
|
||||
|
||||
const validFiles = structures.filter((s) => s.hasContent && !s.error);
|
||||
const emptyFiles = structures.filter((s) => !s.hasContent && !s.error);
|
||||
const emptyFiles = structures.filter((s) => !(s.hasContent || s.error));
|
||||
const errorFiles = structures.filter((s) => s.error);
|
||||
|
||||
console.log(` Total files: ${structures.length}`);
|
||||
@@ -148,7 +148,9 @@ async function analyzeJsonFiles(): Promise<void> {
|
||||
console.log(separator);
|
||||
|
||||
sortedGroups.forEach(([structureKey, files], index) => {
|
||||
if (structureKey === 'empty' || structureKey === 'error') return;
|
||||
if (structureKey === 'empty' || structureKey === 'error') {
|
||||
return;
|
||||
}
|
||||
|
||||
const groupNum = index + 1;
|
||||
console.log(`\nGroup ${groupNum} structure:`);
|
||||
|
||||
Reference in New Issue
Block a user