1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00

clean prettier comments

This commit is contained in:
codecalm
2025-09-23 22:54:13 +02:00
parent 14418a1c08
commit 0c07677606
3 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
// remove-prettier-ignore.js
import { readFileSync, writeFileSync } from 'fs';
import { sync } from 'glob';
const patterns = [
/\/\/ prettier-ignore[\s]*/g,
];
sync('dist/**/*.html').forEach(file => {
let content = readFileSync(file, 'utf8');
let modified = false;
patterns.forEach(pattern => {
const newContent = content.replace(pattern, '');
if (newContent !== content) {
content = newContent;
modified = true;
}
});
if (modified) {
writeFileSync(file, content);
console.log(`Cleaned: ${file}`);
}
});

View File

@@ -18,9 +18,10 @@
"js-minify": "pnpm run js-minify-demo",
"js-minify-demo": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/preview/js/demo.js.map,includeSources,url=demo.min.js.map\" --output dist/preview/js/demo.min.js dist/preview/js/demo.js",
"clean": "shx rm -rf dist demo",
"html": "pnpm run html-build && pnpm run html-prettify",
"html": "pnpm run html-build && pnpm run html-prettify && pnpm run html-remove-prettier-ignore",
"html-build": "eleventy",
"html-prettify": "prettier --write \"dist/**/*.html\" \"!dist/dist/**\"",
"html-remove-prettier-ignore": "node .build/remove-prettier-ignore.mjs",
"svg-optimize": "svgo -f svg/brand --pretty",
"unused-files": "node .build/unused-files.mjs",
"download-images": "node .build/download-images.mjs",