Skip to content

Commit bc440dc

Browse files
committed
style(core): apply consistent formatting to imports and object literals
1 parent 232450c commit bc440dc

13 files changed

Lines changed: 31 additions & 35 deletions

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ insert_final_newline = true
99
trim_trailing_whitespace = true
1010
max_line_length = 120
1111
tab_width = 4
12-

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"formatter": {
2727
"quoteStyle": "double",
2828
"semicolons": "always",
29-
"lineEnding": "lf"
29+
"lineEnding": "lf",
30+
"bracketSpacing": false
3031
}
3132
},
3233
"assist": {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"scripts": {
2121
"test": "bun test",
2222
"type-check": "tsc --noEmit",
23-
"lint": "biome ",
23+
"lint:check": "biome ci",
24+
"lint:fix": "biome check --write",
2425
"syncpack:list": "syncpack list-mismatches",
2526
"syncpack:fix": "syncpack fix-mismatches",
2627
"install:clean": "bun pm cache rm && bunx rimraf bun.lock bun.lockb && bun install"

packages/core/__tests__/caller-trace.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*/
44

55
// noinspection ES6UnusedImports
6-
import { describe, expect, test } from "bun:test";
7-
import { That } from "@thaterror/core";
8-
import { ResultAsync } from "neverthrow";
6+
import {describe, expect, test} from "bun:test";
7+
import {That} from "@thaterror/core";
8+
import {ResultAsync} from "neverthrow";
99

1010
describe("ThatError Location Anchoring", () => {
1111
const AppError = That({
@@ -124,7 +124,7 @@ describe("ThatError Location Anchoring", () => {
124124
* By calling .at() inside this anonymous closure, we lock the stack
125125
* to this exact line in the business logic.
126126
*/
127-
return AppError.ASYNC_ERR(url).with({ cause: error });
127+
return AppError.ASYNC_ERR(url).with({cause: error});
128128
},
129129
);
130130

packages/core/__tests__/define-error.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2019-Present tarnishablec. All Rights Reserved.
33
*/
44

5-
import { describe, expect, test } from "bun:test";
5+
import {describe, expect, test} from "bun:test";
66
import {
77
CodeField,
88
ErrorBrand,
@@ -77,7 +77,7 @@ describe("defineError strict type testing", () => {
7777

7878
test("should support native Error.cause (#[source])", () => {
7979
const original = new Error("Connection lost");
80-
const err = AppError.Unauthorized().with({ cause: original });
80+
const err = AppError.Unauthorized().with({cause: original});
8181

8282
expect(err.cause).toBe(original);
8383

packages/core/__tests__/from-error.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* Copyright 2019-Present tarnishablec. All Rights Reserved.
33
*/
44

5-
import { describe, expect, test } from "bun:test";
6-
import { HTTPException } from "hono/http-exception";
7-
import { AppError } from "./define-error.test";
5+
import {describe, expect, test} from "bun:test";
6+
import {HTTPException} from "hono/http-exception";
7+
import {AppError} from "./define-error.test";
88

99
class MyCustomError extends Error {
1010
prop = 1;

packages/core/__tests__/neverthrow.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
*/
44

55
// noinspection ES6UnusedImports
6-
import { describe, expect, test } from "bun:test";
7-
import {
8-
codeOf,
9-
PayloadField,
10-
payloadOf,
11-
type ThatError,
12-
} from "@thaterror/core";
13-
import { err, fromPromise } from "neverthrow";
14-
import { AppError } from "./define-error.test";
6+
import {describe, expect, test} from "bun:test";
7+
import {codeOf, PayloadField, payloadOf, type ThatError} from "@thaterror/core";
8+
import {err, fromPromise} from "neverthrow";
9+
import {AppError} from "./define-error.test";
1510

1611
describe("neverthrow test", () => {
1712
test("should infer Error type", () => {
@@ -37,7 +32,7 @@ describe("neverthrow test", () => {
3732
const promise = Promise.reject(new Error("fetchData"));
3833

3934
return fromPromise(promise, (e) =>
40-
AppError.NotFound(id).with({ cause: e }),
35+
AppError.NotFound(id).with({cause: e}),
4136
);
4237
};
4338

packages/core/__tests__/pino.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
*/
44

55
// noinspection ES6UnusedImports
6-
import { describe, expect, test } from "bun:test";
7-
import { codeOf, payloadOf, type ThatError } from "@thaterror/core";
6+
import {describe, expect, test} from "bun:test";
7+
import {codeOf, payloadOf, type ThatError} from "@thaterror/core";
88
import pino from "pino";
9-
import { AppError } from "./define-error.test.ts";
9+
import {AppError} from "./define-error.test.ts";
1010

1111
describe("pino logger test", () => {
1212
test("should log error with custom serializers", () => {

packages/core/src/define.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2019-Present tarnishablec. All Rights Reserved.
33
*/
44

5-
import { createFamilyInstance } from "./family.ts";
5+
import {createFamilyInstance} from "./family.ts";
66
import {
77
CodeField,
88
type DefinedError,

packages/core/src/family.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class OperatorImpl<
5757
errorClass: T,
5858
mapper: <_K>(
5959
e: E,
60-
cases: { [K in keyof M & string]: ErrorCase<K, M[K]> },
60+
cases: {[K in keyof M & string]: ErrorCase<K, M[K]>},
6161
) => C,
6262
): ErrorFamily<M, Upsert<Es, E, C>> {
6363
const internalMapper: BridgeEntry<M>["mapper"] = (e, cases) => {
@@ -163,7 +163,7 @@ export function createFamilyInstance<
163163
const op = new OperatorImpl<M, Es>(cases, scope, registry);
164164

165165
const descriptors: PropertyDescriptorMap = {
166-
[ScopeField]: { value: scope, enumerable: false, configurable: false },
166+
[ScopeField]: {value: scope, enumerable: false, configurable: false},
167167
enroll: {
168168
value: op.enroll.bind(op),
169169
enumerable: false,

0 commit comments

Comments
 (0)