Skip to content

Commit 45c07db

Browse files
authored
Merge pull request #1167 from mathjax/script-defaults
Update lint and format scripts to allow specifying the files to process
2 parents bacc102 + 5ff1790 commit 45c07db

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
],
6868
"scripts": {
6969
"=============================================================================== code hygene": "",
70-
"lint": "eslint ts/",
71-
"lint:fix": "eslint --fix ts/ --format unix",
72-
"format": "prettier --check \"ts/**/*.{ts,tsx}\"",
73-
"format:fix": "prettier --write \"ts/**/*.{ts,tsx}\"",
70+
"lint": "check() { eslint ${1:-ts/}; }; check",
71+
"lint:fix": "fix() { eslint --fix ${1:-ts/}; -- format unix}; fix",
72+
"format": "check() { prettier --check ${1:-\"ts/**/*.{ts,tsx}\"}; }; check",
73+
"format:fix": "fix() { prettier --write ${1:-\"ts/**/*.{ts,tsx}\"}; }; fix",
7474
"=============================================================================== clean": "",
7575
"clean:dir": "clean() { pnpm -s log:single \"Cleaning $1 directory\"; pnpm rimraf $1; }; clean",
7676
"clean:lib": "clean() { pnpm -s log:single \"Cleaning $1 component libs\"; pnpm rimraf -g components/$1'/**/lib'; }; clean",
@@ -122,7 +122,7 @@
122122
"build-mjs": "pnpm -s mjs:build",
123123
"make-cjs-components": "pnpm -s cjs:components:make && pnpm -s cjs:bundle:finalize",
124124
"make-mjs-components": "pnpm -s mjs:components:make",
125-
"make-one": "make() { components/bin/makeAll --no-subdirs $3 $4 --$2 components/$2/$1; }; make",
125+
"make-one": "make() { components/bin/makeAll --no-subdirs $3 $4 --${2:-mjs} components/${2-:mjs}/$1; }; make",
126126
"make-components": "pnpm -s make-mjs-components",
127127
"compile": "pnpm -s compile-mjs",
128128
"build": "pnpm -s build-mjs",

0 commit comments

Comments
 (0)