Skip to content

Commit eb80223

Browse files
committed
style: apply consistent formatting to code and configuration files
1 parent bc440dc commit eb80223

13 files changed

Lines changed: 42 additions & 33 deletions

File tree

.syncpackrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://unpkg.com/syncpack/dist/schema.json",
2+
"$schema": "node_modules/syncpack/dist/schema.json",
33
"versionGroups": [
44
{
55
"label": "Use workspace protocol when developing local packages",

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"formatter": {
2727
"quoteStyle": "double",
2828
"semicolons": "always",
29-
"lineEnding": "lf",
30-
"bracketSpacing": false
29+
"lineEnding": "lf"
3130
}
3231
},
3332
"assist": {

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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
*/
44

55
// noinspection ES6UnusedImports
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";
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";
1015

1116
describe("neverthrow test", () => {
1217
test("should infer Error type", () => {
@@ -32,7 +37,7 @@ describe("neverthrow test", () => {
3237
const promise = Promise.reject(new Error("fetchData"));
3338

3439
return fromPromise(promise, (e) =>
35-
AppError.NotFound(id).with({cause: e}),
40+
AppError.NotFound(id).with({ cause: e }),
3641
);
3742
};
3843

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,

packages/core/src/index.ts

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

5-
export {That} from "./define";
6-
export {isDefinedError} from "./is";
5+
export { That } from "./define";
6+
export { isDefinedError } from "./is";
77
export * from "./of";
88

99
export * from "./types";

0 commit comments

Comments
 (0)