From 9c869af1c088f23481c6a16ce0424b47fe8d070e Mon Sep 17 00:00:00 2001 From: aiweithesushigirl Date: Mon, 10 Jun 2024 10:07:18 -0400 Subject: [PATCH] feat(ci): add linting rule to ci --- .github/workflows/prettier.yaml | 16 +++++++ README.md | 2 + package.json | 6 ++- src/tokens/bartio/defaultTokenList.json | 5 ++- .../bartio/defaultValidatorList.json | 42 +++++++++---------- src/write.js | 4 +- yarn.lock | 5 +++ 7 files changed, 54 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/prettier.yaml diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml new file mode 100644 index 000000000..52f78bcaa --- /dev/null +++ b/.github/workflows/prettier.yaml @@ -0,0 +1,16 @@ +name: Lint Check +on: [push, pull_request, merge_group] +jobs: + test: + runs-on: ubuntu-latest + name: Lint Check + steps: + - uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 18 + - name: Install prettier + run: npm install -g prettier + - name: Check linting + run: prettier --check src/ diff --git a/README.md b/README.md index 2b4f30880..000bc9ba1 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,10 @@ To request that we add a validator to the list, [file an issue](https://github.com/berachain/default-lists/issues/new?assignees=&labels=validator+request&projects=&template=validator-request.md&title=Add+%7BVALIDATOR_NAME%7D). ## Contributing + - ℹī¸ PLEASE ADD YOUR NEW ITEM TO THE TOP OF THE LIST TO AVOID JSON TRAILING COMMA ISSUE 🚀 - ℹī¸ AFTER OPENING AN ISSUE, CREATE A BRANCH AND ADD YOUR CHANGES. WHEN READY, CREATE A PR AND LINK YOUR ISSUE IN THE PR 🚀 +- ℹī¸ PLEASE RUN `pnpm lint`BEFORE YOU PUSH 🚀 ### Disclaimer diff --git a/package.json b/package.json index 6abe4c1f4..1f10fd725 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "test": "mocha", "build": "rimraf build && mkdir -p build", - "prepublishOnly": "npm test && npm run build" + "prepublishOnly": "npm test && npm run build", + "lint": "prettier --write src/" }, "files": [ "build/berachain-default.tokenlist.json" @@ -34,5 +35,8 @@ "chai": "^4.2.0", "mocha": "^8.0.1", "rimraf": "^3.0.2" + }, + "dependencies": { + "prettier": "^3.3.1" } } diff --git a/src/tokens/bartio/defaultTokenList.json b/src/tokens/bartio/defaultTokenList.json index 3c29ce3ef..0b354fe95 100644 --- a/src/tokens/bartio/defaultTokenList.json +++ b/src/tokens/bartio/defaultTokenList.json @@ -30,7 +30,7 @@ "deposit": { "name": "Deposit Token", "description": "Tokens that can be deposited in Bend" - }, + }, "rewardToken": { "name": "Reward Token", "description": "Tokens that are used for vault deposits to earn BGT rewards" @@ -118,7 +118,8 @@ "decimals": 18, "logoURI": "https://artio-static-asset-public.s3.ap-southeast-1.amazonaws.com/assets/honey.png", "tags": ["supply"] - },{ + }, + { "chainId": 80084, "address": "0x8Ce5C1c42CD58B7aE61512790e514a82d84375Ed", "symbol": "aWETH", diff --git a/src/validators/bartio/defaultValidatorList.json b/src/validators/bartio/defaultValidatorList.json index a382a7fc2..536ec8158 100644 --- a/src/validators/bartio/defaultValidatorList.json +++ b/src/validators/bartio/defaultValidatorList.json @@ -18,12 +18,12 @@ "twitter": "https://x.com/allnodes" }, { - "id": "0xA7B927Cc85bFB997765aC86a86e46d36413e9B57", - "logoURI": "https://res.cloudinary.com/duv0g402y/raw/upload/src/assets/nodemeister.png", - "name": "nodemeister", - "description": "freedom through decentralization", - "website": "", - "twitter": "https://x.com/nodemeister" + "id": "0xA7B927Cc85bFB997765aC86a86e46d36413e9B57", + "logoURI": "https://res.cloudinary.com/duv0g402y/raw/upload/src/assets/nodemeister.png", + "name": "nodemeister", + "description": "freedom through decentralization", + "website": "", + "twitter": "https://x.com/nodemeister" }, { "id": "0x3Ab20D8fC60bDEddC1195C82eFD971024E7f90f4", @@ -256,7 +256,7 @@ "description": "Staking and relaying Hub for Cosmos ecosystem", "website": "https://www.stakelab.zone", "twitter": "https://x.com/StakeLab" - }, + }, { "id": "0x4AfB6199d1A92D1236cAa74b8dFE99F1EA3A8fF2", "logoURI": "https://raw.githubusercontent.com/StakeUs/Stakeus_LOGO/main/logo-no-background.png", @@ -272,7 +272,7 @@ "description": "OriginStake is a trusted Proof-of-Stake infrastructure provider and validator to comfortably stake your coins and earn rewards with Berachain.", "website": "https://originstake.com", "twitter": "https://x.com/originstake" - }, + }, { "id": "0x73B969ADE706e89469134f3b78b4E74FC16477bE", "logoURI": "https://raw.githubusercontent.com/blacknodes/logos/main/logo-no-background.png", @@ -463,7 +463,7 @@ "description": "Trusted infrastructure and validator service provider for over 50 networks. Dedicated to delivering reliable and secure solutions. ", "website": "https://stakingcabin.com", "twitter": "https://twitter.com/StakingCabin" - }, + }, { "id": "0x1Cc335D9c67a71C777282fdb28b0a2d5eBf42AF4", "logoURI": "https://res.cloudinary.com/duv0g402y/raw/upload/src/assets/flipside.png", @@ -497,12 +497,12 @@ "twitter": "https://x.com/Provalidator" }, { - "id": "0x462f0560e473e1545Fd4d0680C02c499aaf01711", - "logoURI": "https://i0.wp.com/h2o-nodes.com/wp-content/uploads/2022/05/H2O-Nodes-logo-A1-4095064980-1653758705955.jpg", - "name": "H2O Nodes", - "description": "On Prem Validators from Austria", - "website": "https://www.h2o-nodes.com", - "twitter": "https://www.twitter.com/H2oNodes" + "id": "0x462f0560e473e1545Fd4d0680C02c499aaf01711", + "logoURI": "https://i0.wp.com/h2o-nodes.com/wp-content/uploads/2022/05/H2O-Nodes-logo-A1-4095064980-1653758705955.jpg", + "name": "H2O Nodes", + "description": "On Prem Validators from Austria", + "website": "https://www.h2o-nodes.com", + "twitter": "https://www.twitter.com/H2oNodes" }, { "id": "0x201c74de018aa34214BEEFFaF717e1d5F36261a7", @@ -521,12 +521,12 @@ "twitter": "https://twitter.com/brightlystake" }, { - "id": "0x1ab189B7801140900C711E458212F9c76F8dAC79", - "logoURI": "https://raw.githubusercontent.com/Frixoe/lgnsmeta/main/lugahils.jpeg", - "name": "Luganodes", - "description": "Swiss-Operated Institutional Grade Staking Provider", - "website": "https://luganodes.com", - "twitter": "https://x.com/luganodes" + "id": "0x1ab189B7801140900C711E458212F9c76F8dAC79", + "logoURI": "https://raw.githubusercontent.com/Frixoe/lgnsmeta/main/lugahils.jpeg", + "name": "Luganodes", + "description": "Swiss-Operated Institutional Grade Staking Provider", + "website": "https://luganodes.com", + "twitter": "https://x.com/luganodes" }, { "id": "0x2C8D3b794c5FC05Fe6A91AD4C4F3a66620ff9aa5", diff --git a/src/write.js b/src/write.js index c9375068f..675de8700 100644 --- a/src/write.js +++ b/src/write.js @@ -1,3 +1,3 @@ -const buildList = require('./buildList'); +const buildList = require("./buildList"); -buildList().then(data => console.log(JSON.stringify(data, null, 2))); \ No newline at end of file +buildList().then((data) => console.log(JSON.stringify(data, null, 2))); diff --git a/yarn.lock b/yarn.lock index 18f37f534..e46e9a713 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2505,6 +2505,11 @@ prettier@^3.0.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== +prettier@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.1.tgz#e68935518dd90bb7ec4821ba970e68f8de16e1ac" + integrity sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg== + process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"