Introduces a new npm command: `npm run fixmod` which, unlike `npm run
fix`, only fixes modified files in the current git repository. This is
faster than the comprehensive `npm run fix` solution and can hence be
called more often with less disturbance.
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
"lint": "npm run lint:tslint && npm run lint:prettier && npm run lint:html",
"fix:prettier": "prettier --write \"{src,e2e}/**/*.{ts,scss}\"",
"fix:tslint": "npm run lint:tslint -- --fix",
+ "fixmod": "prettier --write $(git rev-parse --show-toplevel)/$(git status --porcelain | grep -E '^(\\sM|\\?\\?|A)' | sed -e 's/^...//' | grep -E '^(src|e2e).*\\.(ts|scss)$') 1>/dev/null 2>&1 && echo 'done' || echo 'no changes found'",
"fix": "npm run fix:tslint; npm run fix:prettier"
},
"private": true,