From 1217910ebd9f251418ca2f55aa5a289fc900a563 Mon Sep 17 00:00:00 2001 From: Jiahao Guo Date: Fri, 10 Nov 2023 11:41:29 +0800 Subject: [PATCH 1/2] chore: configure Prettier for project part 1/2 of #17 --- .github/workflows/ci.yml | 3 +++ .prettierignore | 1 + package.json | 4 ++++ pnpm-lock.yaml | 21 +++++++++++++++++++++ prettier.config.cjs | 1 + 5 files changed, 30 insertions(+) create mode 100644 .prettierignore create mode 100644 prettier.config.cjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f05d31b..7984455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,8 @@ jobs: - name: ๐Ÿ“ฆ Install dependencies run: pnpm install + - name: ๐ŸŽจ Lint project + run: pnpm run lint + - name: ๐Ÿงช Test project run: pnpm test \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..eeeb7be --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +pnpm-lock.yaml \ No newline at end of file diff --git a/package.json b/package.json index ef0b1fd..450ce1a 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,15 @@ "url": "https://github.com/RightCapitalHQ/renovate-config/issues" }, "scripts": { + "lint": "prettier -c .", + "fix": "prettier -w .", "validate": "renovate-config-validator --strict default.json", "test": "pnpm run validate", "prepare": "pnpm run test" }, "devDependencies": { + "@rightcapital/prettier-config": "6.0.4", + "prettier": "3.0.3", "renovate": "latest" }, "packageManager": "pnpm@8.10.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6bea9a..6207e9a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,12 @@ settings: excludeLinksFromLockfile: false devDependencies: + '@rightcapital/prettier-config': + specifier: 6.0.4 + version: 6.0.4(prettier@3.0.3) + prettier: + specifier: 3.0.3 + version: 3.0.3 renovate: specifier: latest version: 37.42.0(typanion@3.14.0) @@ -1553,6 +1559,15 @@ packages: engines: {node: ^18.12.0 || >= 20.0.0, pnpm: ^8.6.11} dev: true + /@rightcapital/prettier-config@6.0.4(prettier@3.0.3): + resolution: {integrity: sha512-1EFZMH71nZM6bb6zOz8SzLalVZl/8iKOYNuuIr4uy26ZJKsQDhEuwUePvmH7dIp4AS124uHlYOKW2Zf+x/sGsw==} + engines: {node: '>=16.0.0'} + peerDependencies: + prettier: ^3.0.0 + dependencies: + prettier: 3.0.3 + dev: true + /@seald-io/binary-search-tree@1.0.3: resolution: {integrity: sha512-qv3jnwoakeax2razYaMsGI/luWdliBLHTdC6jU55hQt1hcFqzauH/HsBollQ7IR4ySTtYhT+xyHoijpA16C+tA==} dev: true @@ -4562,6 +4577,12 @@ packages: hasBin: true dev: true + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + engines: {node: '>=14'} + hasBin: true + dev: true + /pretty-bytes@5.6.0: resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==} engines: {node: '>=6'} diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000..fa5f7c7 --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1 @@ +module.exports = require('@rightcapital/prettier-config'); From ee3519a80b304bf2a37d91571312740523aa846d Mon Sep 17 00:00:00 2001 From: Jiahao Guo Date: Fri, 10 Nov 2023 11:42:04 +0800 Subject: [PATCH 2/2] style: format code with Prettier --- .github/workflows/ci.yml | 4 ++-- README.md | 9 ++++----- default.json | 15 +++------------ renovate.json | 6 ++---- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7984455..5d717e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - run: corepack enable - uses: actions/setup-node@v4 with: - cache: "pnpm" + cache: 'pnpm' - name: ๐Ÿ“ฆ Install dependencies run: pnpm install @@ -26,4 +26,4 @@ jobs: run: pnpm run lint - name: ๐Ÿงช Test project - run: pnpm test \ No newline at end of file + run: pnpm test diff --git a/README.md b/README.md index 88dd823..53869dd 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,14 @@ A [shareable config preset](https://docs.renovatebot.com/config-presets/) for Re ## Usage -Enable Renovate in your repository and just `extends` in *renovate.json*. +Enable Renovate in your repository and just `extends` in _renovate.json_. ```json { - "extends": [ - "github>RightCapitalHQ/renovate-config" - ] + "extends": ["github>RightCapitalHQ/renovate-config"] } ``` + > [!NOTE] > You don't have to do `npm i -D @RightCapitalHQ/renovate-config`. Renovate fetches it from this GitHub repo automatically. @@ -33,4 +32,4 @@ Enable Renovate in your repository and just `extends` in *renovate.json*. ## License -[MIT License](https://opensource.org/licenses/MIT) \ No newline at end of file +[MIT License](https://opensource.org/licenses/MIT) diff --git a/default.json b/default.json index 9a2d43c..0e828da 100644 --- a/default.json +++ b/default.json @@ -1,13 +1,8 @@ { "automergeType": "pr", "description": "Default config for RightCapital repositories", - "extends": [ - "config:recommended", - ":pinAllExceptPeerDependencies" - ], - "labels": [ - "renovate" - ], + "extends": ["config:recommended", ":pinAllExceptPeerDependencies"], + "labels": ["renovate"], "npm": { "commitMessageTopic": "{{prettyDepType}} {{depName}}" }, @@ -21,11 +16,7 @@ } ], "platformAutomerge": true, - "postUpdateOptions": [ - "npmDedupe", - "pnpmDedupe", - "yarnDedupeFewer" - ], + "postUpdateOptions": ["npmDedupe", "pnpmDedupe", "yarnDedupeFewer"], "prCreation": "immediate", "rangeStrategy": "auto" } diff --git a/renovate.json b/renovate.json index 1bd6e34..093d4d6 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "github>RightCapitalHQ/renovate-config" - ] -} \ No newline at end of file + "extends": ["github>RightCapitalHQ/renovate-config"] +}