From 9ec96d6393e35a949b29a780694fa3d795ce8c81 Mon Sep 17 00:00:00 2001 From: Heinous Tugboat Date: Sat, 1 Oct 2022 10:39:03 -0400 Subject: [PATCH] Updates prettier configuration and adds prettier workflow --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- .prettierignore | 2 ++ .vscode/settings.json | 10 ++++++++++ package.json | 1 + 4 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 .prettierignore create mode 100644 .vscode/settings.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0930f65..b28e404 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,20 +24,20 @@ jobs: # run: npm ci # - name: Run linter # run: npm run lint:report - # prettier: - # name: Prettier - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js 16.13.1 - # uses: actions/setup-node@v2 - # with: - # node-version: 16.13.1 - # cache: "npm" - # - name: Install npm dependencies - # run: npm ci - # - name: Run prettier check - # run: npm run format:report + prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 16.13.1 + uses: actions/setup-node@v2 + with: + node-version: 16.13.1 + cache: "npm" + - name: Install npm dependencies + run: npm ci + - name: Run prettier check + run: npm run format:report test: name: Test runs-on: ubuntu-latest diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4a0238f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + } +} diff --git a/package.json b/package.json index a4b1523..7a9ded1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "main": "./npx/bitburner-filesync.ts", "scripts": { "format": "prettier -w .", + "format:report": "prettier -c .", "test:all": "mocha --recursive test", "test:single": "mocha", "start": "npx/bitburner-filesync.ts"