diff --git a/eslint.config.mjs b/eslint.config.mjs index 8348e3a..a53ec38 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,7 @@ export default tseslint.config( "bin/**/*.ts", "bench/**/*.ts", "src/**/*.ts", + "scripts/**/*.ts", "test/**/*.ts", "eslint.config.js", ], diff --git a/package.json b/package.json index 829d074..48d604d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "prebuild-wasm": "npm run wasm -- --prebuild && npm run wasm -- --setup", "build-wasm": "npm run wasm -- --docker", "wasm": "node --import tsx bin/build_wasm.ts", - "clean": "rm -rf lib && rm -rf test/tmp", + "clean": "node --import tsx scripts/clean.ts", "prepare": "npm run clean && npm run build-ts", "test": "node --import tsx ./test/md-test.ts", "lint": "eslint", diff --git a/scripts/clean.ts b/scripts/clean.ts new file mode 100644 index 0000000..d1763fe --- /dev/null +++ b/scripts/clean.ts @@ -0,0 +1,11 @@ +#!/usr/bin/env -S node --import tsx + +import { rmSync } from "fs"; + +/* +Some operating systems do not have the ability to perform +rm -rf ... (example: Windows) +*/ + +rmSync('lib', {'force':true, 'recursive':true}) +rmSync('test/tmp', {'force':true, 'recursive':true}) diff --git a/tsconfig.test.json b/tsconfig.test.json index 1328441..6fff347 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -4,5 +4,5 @@ "allowJs": true, "checkJs": true }, - "include": ["bench/**/*.ts", "bin/**/*.ts", "src/**/*.ts", "test/**/*.ts", "eslint.config.mjs"], + "include": ["bench/**/*.ts", "bin/**/*.ts", "src/**/*.ts", "test/**/*.ts", "scripts/**/*.ts","eslint.config.mjs"], }