From 1e6b2894a9867fe1da13ad64a7e14f48844c83cd Mon Sep 17 00:00:00 2001 From: Robat Williams Date: Fri, 15 Dec 2023 16:47:04 +0000 Subject: [PATCH] Prettier on CI --- .github/workflows/ci.yml | 13 +++++++++++++ .prettierrc.yml | 12 ++++++------ .vscode/extensions.json | 6 +++--- .vscode/settings.json | 20 ++++++++++---------- package.json | 1 + 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffd0597..f6688ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,19 @@ on: - 'main' jobs: + code_quality: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + cache: 'npm' + - run: npm ci + - run: npm run prettier:check + test: runs-on: ubuntu-latest diff --git a/.prettierrc.yml b/.prettierrc.yml index 0c05943..fc0ffe2 100644 --- a/.prettierrc.yml +++ b/.prettierrc.yml @@ -1,6 +1,6 @@ -singleQuote: true -overrides: - - files: '*.md' - options: - printWidth: 120 - proseWrap: never +singleQuote: true +overrides: + - files: '*.md' + options: + printWidth: 120 + proseWrap: never diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 53dd67c..c83e263 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ -{ - "recommendations": ["esbenp.prettier-vscode"] -} +{ + "recommendations": ["esbenp.prettier-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index bdffcca..a0af8ba 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,10 @@ -{ - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.rulers": [80], - "editor.tabSize": 2, - - "files.eol": "\n", - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true -} +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.rulers": [80], + "editor.tabSize": 2, + + "files.eol": "\n", + "files.insertFinalNewline": true, + "files.trimFinalNewlines": true, + "files.trimTrailingWhitespace": true +} diff --git a/package.json b/package.json index 1a1bd9e..a398ef3 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "main": "index.js", "scripts": { "install-certs": "office-addin-dev-certs install --days 3650", + "prettier:check": "prettier --check .", "sideload:desktop": "office-addin-debugging start manifest-localhost.xml desktop --no-debug", "start": "http-server --tls --cert ~/.office-addin-dev-certs/localhost.crt --key ~/.office-addin-dev-certs/localhost.key --port 3000 --cors -c-1", "test": "node --test --require=./testFramework/excelStubs.cjs"