Skip to content

Commit 7fc4446

Browse files
committed
1.0.2
1 parent 080c42a commit 7fc4446

File tree

3 files changed

+31
-8
lines changed

3 files changed

+31
-8
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
/.idea
22
/node_modules
3-
4-
# Project exclude paths
5-
/src/build-map.js
6-
/src/index.js

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"name": "@idrinth/duplicate-style-check",
3-
"version": "1.0.0",
4-
"description": "",
3+
"version": "1.0.2",
4+
"description": "A linting tool trying to find duplicated stylings",
55
"type": "module",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"tsc": "tsc -p tsconfig.json"
7+
"tsc": "tsc -p tsconfig.json",
8+
"prepublishOnly": "npm run tsc",
9+
"postpublishOnly": "npm run clear",
10+
"clear": "node tools/clear-js-files-from-src.js"
911
},
1012
"private": false,
1113
"dependencies": {
@@ -16,5 +18,9 @@
1618
"@types/node": "^20.10.6",
1719
"typescript": "^5.3.3",
1820
"ts-node": "^10.9.2"
21+
},
22+
"bin": {
23+
"lint-css-duplicates": "bin/lint-css-duplicates.js",
24+
"ilcd": "bin/lint-css-duplicates.js"
1925
}
2026
}

tools/clear-js-files-from-src.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {
2+
rmSync,
3+
readdirSync, existsSync,
4+
} from 'fs';
5+
import {
6+
fileURLToPath,
7+
} from 'url';
8+
const __dirname = fileURLToPath(new URL('.', import.meta.url,),);
9+
const clearFolder = (folder,) => {
10+
for (const file of readdirSync(folder, {
11+
recursive: true,
12+
},)) {
13+
if (file.match(/.*\.js/u,)) {
14+
rmSync(`${ folder }/${ file }`,);
15+
}
16+
}
17+
};
18+
clearFolder(__dirname + '../src',);
19+
if (existsSync(__dirname + '../index.js')) {
20+
rmSync(__dirname + '../index.js',);
21+
}

0 commit comments

Comments
 (0)