From 3c6429a3c03a570f9bd28738c4f406d84e207125 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Sat, 16 Nov 2024 15:46:03 -0500 Subject: [PATCH] Update lint and format scripts to allow specifying the files to process --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 80a415cc0..16c4e85a3 100644 --- a/package.json +++ b/package.json @@ -67,10 +67,10 @@ ], "scripts": { "=============================================================================== code hygene": "", - "lint": "eslint ts/", - "lint:fix": "eslint --fix ts/", - "format": "prettier --check \"ts/**/*.{ts,tsx}\"", - "format:fix": "prettier --write \"ts/**/*.{ts,tsx}\"", + "lint": "check() { eslint ${1:-ts/}; }; check", + "lint:fix": "fix() { eslint --fix ${1:-ts/}; }; fix", + "format": "check() { prettier --check ${1:-\"ts/**/*.{ts,tsx}\"}; }; check", + "format:fix": "fix() { prettier --write ${1:-\"ts/**/*.{ts,tsx}\"}; }; fix", "=============================================================================== clean": "", "clean:dir": "clean() { pnpm -s log:single \"Cleaning $1 directory\"; pnpm rimraf $1; }; clean", "clean:lib": "clean() { pnpm -s log:single \"Cleaning $1 component libs\"; pnpm rimraf -g components/$1'/**/lib'; }; clean", @@ -122,7 +122,7 @@ "build-mjs": "pnpm -s mjs:build", "make-cjs-components": "pnpm -s cjs:components:make && pnpm -s cjs:bundle:finalize", "make-mjs-components": "pnpm -s mjs:components:make", - "make-one": "make() { components/bin/makeAll --no-subdirs $3 $4 --$2 components/$2/$1; }; make", + "make-one": "make() { components/bin/makeAll --no-subdirs $3 $4 --${2:-mjs} components/${2-:mjs}/$1; }; make", "make-components": "pnpm -s make-mjs-components", "compile": "pnpm -s compile-mjs", "build": "pnpm -s build-mjs",