From 605dd9191250c984d5cbb1b25094026029240629 Mon Sep 17 00:00:00 2001 From: Luciano Mammino Date: Wed, 28 Feb 2024 21:32:40 +0000 Subject: [PATCH] chore: made biome happy --- biome.json | 23 +++++------------------ test/bun.test.ts | 2 +- test/deno.ts | 14 ++------------ test/examples.test.ts | 20 +++----------------- 4 files changed, 11 insertions(+), 48 deletions(-) diff --git a/biome.json b/biome.json index 5dbea5a..f3c46ca 100644 --- a/biome.json +++ b/biome.json @@ -16,11 +16,7 @@ "all": true } }, - "ignore": [ - "coverage/", - "dist/", - "node_modules/" - ] + "ignore": ["coverage/", "dist/", "node_modules/", "docs/"] }, "formatter": { "enabled": true, @@ -28,22 +24,13 @@ "indentStyle": "space", "indentWidth": 2, "lineWidth": 80, - "ignore": [ - "coverage/", - "dist/", - "node_modules/" - ] + "ignore": ["coverage/", "dist/", "node_modules/", "docs/"] }, "javascript": { "formatter": { "semicolons": "asNeeded", "quoteStyle": "single" - } - "globals": [ - "Deno", - "describe", - "test", - "expect" - ] + }, + "globals": ["Deno", "describe", "test", "expect", "it"] } -} \ No newline at end of file +} diff --git a/test/bun.test.ts b/test/bun.test.ts index 4ae90df..ee6a3a0 100644 --- a/test/bun.test.ts +++ b/test/bun.test.ts @@ -1,4 +1,4 @@ -import { expect, test } from "bun:test" +import { expect, test } from 'bun:test' import { fv, pmt, diff --git a/test/deno.ts b/test/deno.ts index 9e172dd..4c7492a 100644 --- a/test/deno.ts +++ b/test/deno.ts @@ -1,13 +1,5 @@ import { assertEquals } from 'https://deno.land/std/assert/mod.ts' -import { - fv, - pmt, - nper, - ipmt, - pv, - irr, - npv, -} from '../src/index.ts' +import { fv, pmt, nper, ipmt, pv, irr, npv } from '../src/index.ts' Deno.test('fv()', () => { assertEquals(fv(0.05 / 12, 10 * 12, -100, -100), 15692.928894335755) @@ -24,9 +16,7 @@ Deno.test('nper()', () => { Deno.test('ipmt()', () => { const principal = 2500 const periods = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] - const ipmts = periods.map((per) => - ipmt(0.0824 / 12, per, 1 * 12, principal), - ) + const ipmts = periods.map((per) => ipmt(0.0824 / 12, per, 1 * 12, principal)) assertEquals( ipmts, [ diff --git a/test/examples.test.ts b/test/examples.test.ts index 271e73c..396ae9f 100644 --- a/test/examples.test.ts +++ b/test/examples.test.ts @@ -1,12 +1,4 @@ -import { - fv, - pmt, - nper, - ipmt, - pv, - irr, - npv, -} from '../src/index.ts' +import { fv, pmt, nper, ipmt, pv, irr, npv } from '../src/index.ts' describe('Source code docs examples', () => { test('fv()', () => { @@ -17,10 +9,7 @@ describe('Source code docs examples', () => { }) test('pmt()', () => { - expect(pmt(0.075 / 12, 12 * 15, 200000)).toBeCloseTo( - -1854.0247200054619, - 6, - ) + expect(pmt(0.075 / 12, 12 * 15, 200000)).toBeCloseTo(-1854.0247200054619, 6) }) test('nper()', () => { @@ -65,9 +54,6 @@ describe('Source code docs examples', () => { const initialCashflow = cashflows[0] cashflows[0] = 0 - expect(npv(rate, cashflows) + initialCashflow).toBeCloseTo( - 3065.22266817, - 6, - ) + expect(npv(rate, cashflows) + initialCashflow).toBeCloseTo(3065.22266817, 6) }) })