style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -1,48 +1,48 @@
import { describe, expect, test } from "bun:test";
import { z } from "zod/v4";
import { semanticBoolean } from "../semanticBoolean";
import { describe, expect, test } from 'bun:test'
import { z } from 'zod/v4'
import { semanticBoolean } from '../semanticBoolean'
describe("semanticBoolean", () => {
test("parses boolean true to true", () => {
expect(semanticBoolean().parse(true)).toBe(true);
});
describe('semanticBoolean', () => {
test('parses boolean true to true', () => {
expect(semanticBoolean().parse(true)).toBe(true)
})
test("parses boolean false to false", () => {
expect(semanticBoolean().parse(false)).toBe(false);
});
test('parses boolean false to false', () => {
expect(semanticBoolean().parse(false)).toBe(false)
})
test("parses string 'true' to true", () => {
expect(semanticBoolean().parse("true")).toBe(true);
});
expect(semanticBoolean().parse('true')).toBe(true)
})
test("parses string 'false' to false", () => {
expect(semanticBoolean().parse("false")).toBe(false);
});
expect(semanticBoolean().parse('false')).toBe(false)
})
test("rejects string 'TRUE' (case-sensitive)", () => {
expect(() => semanticBoolean().parse("TRUE")).toThrow();
});
expect(() => semanticBoolean().parse('TRUE')).toThrow()
})
test("rejects string 'FALSE' (case-sensitive)", () => {
expect(() => semanticBoolean().parse("FALSE")).toThrow();
});
expect(() => semanticBoolean().parse('FALSE')).toThrow()
})
test("rejects number 1", () => {
expect(() => semanticBoolean().parse(1)).toThrow();
});
test('rejects number 1', () => {
expect(() => semanticBoolean().parse(1)).toThrow()
})
test("rejects null", () => {
expect(() => semanticBoolean().parse(null)).toThrow();
});
test('rejects null', () => {
expect(() => semanticBoolean().parse(null)).toThrow()
})
test("rejects undefined", () => {
expect(() => semanticBoolean().parse(undefined)).toThrow();
});
test('rejects undefined', () => {
expect(() => semanticBoolean().parse(undefined)).toThrow()
})
test("works with custom inner schema (z.boolean().optional())", () => {
const schema = semanticBoolean(z.boolean().optional());
expect(schema.parse(true)).toBe(true);
expect(schema.parse("false")).toBe(false);
expect(schema.parse(undefined)).toBeUndefined();
});
});
test('works with custom inner schema (z.boolean().optional())', () => {
const schema = semanticBoolean(z.boolean().optional())
expect(schema.parse(true)).toBe(true)
expect(schema.parse('false')).toBe(false)
expect(schema.parse(undefined)).toBeUndefined()
})
})