Skip to content

Commit

Permalink
Merge pull request #88 from LaurelineSwissBorg/chore/add-linter
Browse files Browse the repository at this point in the history
chore: Add Prettier + ESlint (w/ yarn 3.6)
  • Loading branch information
lomigmegard authored May 13, 2024
2 parents c672f69 + ea61f0b commit 3de8b65
Show file tree
Hide file tree
Showing 15 changed files with 5,796 additions and 5,582 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,14 @@ jobs:
node-version: ">=18.0.0"
- name: Test
run: yarn install && yarn test
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: ">=18.0.0"
- name: Test
run: yarn prettier --check .
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ Thumbs.db
# Ignore built ts files
dist/**/*

# ignore yarn.lock
yarn.lock

.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github/
.yarn/
testData/
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodeLinker: node-modules
nodeLinker: node-modules
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@ https://swissborg.com/blog/proof-of-liabilities
## Previous audits

| Date | Audit ID | Merkle Root Hash |
| - | - | - |
| ----------------------- | ------------- | ------------------------------------------------------------------ |
| 2023-11-01 20:59:59 UTC | SBPOL20231101 | `da3f5b768545a6bc149326a807498538c50d5bacd7147bf6e14896585b8fad1b` |
| 2023-10-01 20:59:59 UTC | SBPOL20231001 | `af2cd8dc97e385f7987e46fd91d2903c41adac3a626dc3646254fcc6bb62ea62` |
| 2023-09-01 20:59:59 UTC | SBPOL20230901 | `4faa70570d3040d30846ee2c9883d40f829ae150de541db296efe72280112255` |
| 2023-09-01 20:59:59 UTC | SBPOL20230901 | `4faa70570d3040d30846ee2c9883d40f829ae150de541db296efe72280112255` |
| 2023-08-01 20:59:59 UTC | SBPOL20230801 | `9beb400935a7ecb1783fd50df5e08c7d6f29d7013d1dfe50302f7e4fdcf8c55d` |
| 2023-07-01 20:59:59 UTC | SBPOL20230701 | `b22b844610b0b04b3447c15bc96b679f6e45ae9e6df888922c0d155c8242447d` |
| 2023-06-01 20:59:59 UTC | SBPOL20230601 | `b27a0b7633a5fe8337170032ef8a27d9ffe975f6f9e5540ff53616362a26880d` |
| 2023-05-01 20:59:59 UTC | SBPOL20230501 | `59a9aeef522f954aac4b3933ec60e534f7e10d846fad5be7a8e36d952654d476` |
| 2023-04-12 20:59:59 UTC | SBPOL20230412 | `420e493b403cee3b1ce538827e54cb9e2a3f04af0f28b1cb1400de6027ed77c9` |

This data is also available via the SwissBorg API. You can reproduce this by running the command (requires [`jq`](https://jqlang.github.io/jq/))

```bash
curl "https://api.swissborg.io/v1/solvency/audit?limit=5&offset=0" | jq '.audits[] | [.time, .id, .commitment.digest]'
```

## Self Verification

### Requirements
* nodejs v18+
* yarn

- nodejs v18+
- yarn 3.6+

### Installation

Expand Down
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @ts-check

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
);
4 changes: 2 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default {
"ts",
"tsx",
"json",
"node"
"node",
],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
Expand Down Expand Up @@ -156,7 +156,7 @@ export default {
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)",
"tests.ts"
"tests.ts",
],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
Expand Down
Loading

0 comments on commit 3de8b65

Please sign in to comment.