From 2e7197a0a2a7f15c89643e6bd14f65426e170548 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 30 Dec 2020 23:00:06 +0100 Subject: [PATCH 1/2] add auto formatting for .scss and .json files --- package.json | 4 +++- src/scss/components/_items.scss | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 7099f55d..b42633d7 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,8 @@ } }, "lint-staged": { - "*.ts": "eslint --cache --fix" + "*.ts": "eslint --cache --fix", + "*.json": "prettier --write", + "*.scss": "prettier --write" } } diff --git a/src/scss/components/_items.scss b/src/scss/components/_items.scss index d35a84a5..3f089ca3 100644 --- a/src/scss/components/_items.scss +++ b/src/scss/components/_items.scss @@ -51,7 +51,6 @@ margin-top: 0px; padding-top: 0px; } - } } @@ -61,4 +60,4 @@ padding-left: 1em; border-bottom: 2px groove $c-border-groove; font-weight: bold; -} \ No newline at end of file +} From 9ed1b7ec84939e77ed6bbefe23555d9858deef3c Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Wed, 30 Dec 2020 23:05:57 +0100 Subject: [PATCH 2/2] add command to format all sources (except .hbs) --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b42633d7..52a60eab 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "clean": "gulp clean && gulp link --clean", "update": "npm install --save-dev git+https://git.f3l.de/dungeonslayers/foundry-pc-types.git#f3l-fixes", "lint": "eslint 'src/**/*.ts' --cache", - "lint:fix": "eslint 'src/**/*.ts' --cache --fix" + "lint:fix": "eslint 'src/**/*.ts' --cache --fix", + "format": "prettier --write 'src/**/*.(ts|json|scss)'" }, "author": "", "license": "", @@ -45,7 +46,6 @@ }, "lint-staged": { "*.ts": "eslint --cache --fix", - "*.json": "prettier --write", - "*.scss": "prettier --write" + "*.(json|scss)": "prettier --write" } }