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,42 +1,42 @@
import { describe, expect, test } from "bun:test";
import { escapeXml, escapeXmlAttr } from "../xml";
import { describe, expect, test } from 'bun:test'
import { escapeXml, escapeXmlAttr } from '../xml'
describe("escapeXml", () => {
test("escapes ampersand", () => {
expect(escapeXml("a & b")).toBe("a & b");
});
describe('escapeXml', () => {
test('escapes ampersand', () => {
expect(escapeXml('a & b')).toBe('a & b')
})
test("escapes less-than", () => {
expect(escapeXml("<div>")).toBe("&lt;div&gt;");
});
test('escapes less-than', () => {
expect(escapeXml('<div>')).toBe('&lt;div&gt;')
})
test("escapes greater-than", () => {
expect(escapeXml("a > b")).toBe("a &gt; b");
});
test('escapes greater-than', () => {
expect(escapeXml('a > b')).toBe('a &gt; b')
})
test("escapes multiple special chars", () => {
expect(escapeXml("<a & b>")).toBe("&lt;a &amp; b&gt;");
});
test('escapes multiple special chars', () => {
expect(escapeXml('<a & b>')).toBe('&lt;a &amp; b&gt;')
})
test("returns empty string unchanged", () => {
expect(escapeXml("")).toBe("");
});
test('returns empty string unchanged', () => {
expect(escapeXml('')).toBe('')
})
test("returns normal text unchanged", () => {
expect(escapeXml("hello world")).toBe("hello world");
});
});
test('returns normal text unchanged', () => {
expect(escapeXml('hello world')).toBe('hello world')
})
})
describe("escapeXmlAttr", () => {
test("escapes double quotes", () => {
expect(escapeXmlAttr('say "hello"')).toBe("say &quot;hello&quot;");
});
describe('escapeXmlAttr', () => {
test('escapes double quotes', () => {
expect(escapeXmlAttr('say "hello"')).toBe('say &quot;hello&quot;')
})
test("escapes single quotes", () => {
expect(escapeXmlAttr("it's")).toBe("it&apos;s");
});
test('escapes single quotes', () => {
expect(escapeXmlAttr("it's")).toBe('it&apos;s')
})
test("escapes all special chars", () => {
expect(escapeXmlAttr('<a & "b">')).toBe("&lt;a &amp; &quot;b&quot;&gt;");
});
});
test('escapes all special chars', () => {
expect(escapeXmlAttr('<a & "b">')).toBe('&lt;a &amp; &quot;b&quot;&gt;')
})
})