Add prettier config, format codebase

This commit is contained in:
David Haz
2025-07-12 11:59:33 +03:00
parent ac8b2c04d8
commit f4d97ee94e
211 changed files with 10586 additions and 8810 deletions

View File

View File

@@ -1,15 +1,15 @@
import fs from "fs";
import path from "path";
import process from "process";
import fs from 'fs';
import path from 'path';
import process from 'process';
import { fileURLToPath } from "url";
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const args = process.argv.slice(2);
if (args.length < 2) {
console.error("Usage: npm run generate:component <ComponentType> <ComponentName>");
console.error('Usage: npm run generate:component <ComponentType> <ComponentName>');
process.exit(1);
}
@@ -17,12 +17,12 @@ const [componentType, componentName] = args;
const componentNameLower = componentName.charAt(0).toLowerCase() + componentName.slice(1);
const paths = {
content: path.join(__dirname, "../src/content", componentType, componentName),
demo: path.join(__dirname, "../src/demo", componentType),
constants: path.join(__dirname, "../src/constants/code", componentType),
content: path.join(__dirname, '../src/content', componentType, componentName),
demo: path.join(__dirname, '../src/demo', componentType),
constants: path.join(__dirname, '../src/constants/code', componentType)
};
Object.values(paths).forEach((dir) => {
Object.values(paths).forEach(dir => {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
@@ -31,12 +31,12 @@ Object.values(paths).forEach((dir) => {
const files = [
path.join(paths.content, `${componentName}.vue`),
path.join(paths.demo, `${componentName}Demo.vue`),
path.join(paths.constants, `${componentNameLower}Code.ts`),
path.join(paths.constants, `${componentNameLower}Code.ts`)
];
files.forEach((file) => {
files.forEach(file => {
if (!fs.existsSync(file)) {
fs.writeFileSync(file, "");
fs.writeFileSync(file, '');
}
});