harb/kraiken-lib
johba dc61771dfc feat(ponder): Add strict ESLint + Prettier with pre-commit hooks (#52)
- Install eslint, @typescript-eslint plugins, prettier, husky, lint-staged
- Configure ESLint flat config with TypeScript parser
- Enforce: no-explicit-any (with exceptions), no-unused-vars, naming-convention, prefer-const, no-console
- Set style: 2-space indent, 140 char max-len, disable complexity rules
- Configure Prettier: single quotes, 140 width, trailing commas
- Setup husky pre-commit hook to auto-fix and format on commit
- Replace console.log/warn with context.logger.info/warn in handlers
- Remove console.log from ponder.config.ts (replaced with comment)
- Add npm scripts: lint, lint:fix, format, format:check
- All lint rules pass without warnings

resolvel #45

Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/52
2025-10-04 15:37:26 +02:00
..
src feat(ponder): Add strict ESLint + Prettier with pre-commit hooks (#52) 2025-10-04 15:37:26 +02:00
.gitignore Complete project rename from HARB/Harberg to KRAIKEN with KRK token symbol 2025-07-11 13:47:42 +02:00
.prettierrc lint/lib (#49) 2025-10-03 11:57:01 +02:00
AGENTS.md Harden kraiken-lib watch loop and confirm host-built dist propagation (#38) 2025-10-02 14:33:59 +02:00
codegen.yml health checks (#39) 2025-10-02 14:37:59 +02:00
eslint.config.js lint/lib (#49) 2025-10-03 11:57:01 +02:00
jest.config.js Complete project rename from HARB/Harberg to KRAIKEN with KRK token symbol 2025-07-11 13:47:42 +02:00
package-lock.json feat(ponder): Add strict ESLint + Prettier with pre-commit hooks (#52) 2025-10-04 15:37:26 +02:00
package.json lint/lib (#49) 2025-10-03 11:57:01 +02:00
README.md more logic to lib 2025-09-23 16:57:49 +02:00
tsconfig.json fix/podman-postgres-integration (#37) 2025-10-01 20:26:49 +02:00
yarn.lock feat(ponder): Add strict ESLint + Prettier with pre-commit hooks (#52) 2025-10-04 15:37:26 +02:00

Test

yarn test

Import

yarn add kraiken-lib

then

import { bytesToUint256LittleEndian, uint256ToBytesLittleEndian } from "kraiken-lib";

uint256ToBytesLittleEndian(3n);

get Snatch List

import { getSnatchList } from "kraiken-lib";

const positionIds = getSnatchList(positions, neededShares, maxTaxRateDecimal, stakeTotalSupply);