From 8e7564e9954f7ec49eab60102abb8db3366d3bc6 Mon Sep 17 00:00:00 2001 From: Alexander Prinzhorn Date: Mon, 13 Mar 2023 12:26:30 +0100 Subject: [PATCH] Add a prettier npm script (#5986) * Add a prettier npm script * Linting -> Formatting --- .github/workflows/autofix.yml | 2 +- web/README.md | 5 +++-- web/package.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 9429bb476..a9b79f146 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -45,7 +45,7 @@ jobs: - name: Run prettier run: | npm ci - npx prettier --write . + npm run prettier working-directory: web - uses: mhils/add-pr-ref-in-changelog@main diff --git a/web/README.md b/web/README.md index f9f38b6d1..4c242ac2f 100644 --- a/web/README.md +++ b/web/README.md @@ -13,8 +13,9 @@ - Run `npm test` to run the test suite. -## Linting -- Run `npx prettier --write .` to lint your code. +## Code formatting + +- Run `npm run prettier` to format your code. You can also integrate prettier into your editor, see https://prettier.io/docs/en/editors.html ## Architecture diff --git a/web/package.json b/web/package.json index 0f7440742..df4b2b234 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,8 @@ "scripts": { "test": "tsc --noEmit && jest --coverage", "build": "gulp prod", - "start": "gulp" + "start": "gulp", + "prettier": "prettier --write ." }, "dependencies": { "@popperjs/core": "^2.9.3",