Skip to content

Commit b40bf66

Browse files
committed
chore(lint): enable no-zero-fractions
1 parent fce4f10 commit b40bf66

22 files changed

Lines changed: 49 additions & 47 deletions

File tree

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"unicorn/no-instanceof-array": "error",
104104
"unicorn/no-negation-in-equality-check": "error",
105105
"unicorn/no-new-buffer": "error",
106+
"unicorn/no-zero-fractions": "error",
106107
"unicorn/no-thenable": "error",
107108
"unicorn/no-typeof-undefined": "error",
108109
"unicorn/no-unnecessary-array-flat-depth": "error",

extensions/arcee/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const ARCEE_MODEL_CATALOG: ModelDefinitionConfig[] = [
2626
maxTokens: 16384,
2727
cost: {
2828
input: 0.25,
29-
output: 1.0,
29+
output: 1,
3030
cacheRead: 0.25,
3131
cacheWrite: 0.25,
3232
},

extensions/elevenlabs/speech-provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const DEFAULT_ELEVENLABS_MODEL_ID = "eleven_multilingual_v2";
3131
const DEFAULT_ELEVENLABS_VOICE_SETTINGS = {
3232
stability: 0.5,
3333
similarityBoost: 0.75,
34-
style: 0.0,
34+
style: 0,
3535
useSpeakerBoost: true,
36-
speed: 1.0,
36+
speed: 1,
3737
};
3838

3939
const ELEVENLABS_TTS_MODELS = [

extensions/elevenlabs/tts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("elevenlabs tts diagnostics", () => {
1818
similarityBoost: 0.75,
1919
style: 0,
2020
useSpeakerBoost: true,
21-
speed: 1.0,
21+
speed: 1,
2222
},
2323
timeoutMs: 5_000,
2424
};

extensions/huggingface/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const HUGGINGFACE_MODEL_CATALOG: ModelDefinitionConfig[] = [
4646
input: ["text"],
4747
contextWindow: 131072,
4848
maxTokens: 8192,
49-
cost: { input: 3.0, output: 7.0, cacheRead: 3.0, cacheWrite: 3.0 },
49+
cost: { input: 3, output: 7, cacheRead: 3, cacheWrite: 3 },
5050
},
5151
{
5252
id: "deepseek-ai/DeepSeek-V3.1",

extensions/kilocode/provider-models.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ describe("discoverKilocodeModels (fetch path)", () => {
196196
expect(models.length).toBe(2);
197197

198198
const sonnet = requireModelById(models, "anthropic/claude-sonnet-4");
199-
expect(sonnet.cost.input).toBeCloseTo(3.0);
200-
expect(sonnet.cost.output).toBeCloseTo(15.0);
199+
expect(sonnet.cost.input).toBeCloseTo(3);
200+
expect(sonnet.cost.output).toBeCloseTo(15);
201201
expect(sonnet.cost.cacheRead).toBeCloseTo(0.3);
202202
expect(sonnet.cost.cacheWrite).toBeCloseTo(3.75);
203203
expect(sonnet.input).toEqual(["text", "image"]);
@@ -282,7 +282,7 @@ describe("discoverKilocodeModels (fetch path)", () => {
282282
const models = await discoverKilocodeModels();
283283
const auto = requireModelById(models, "kilo/auto");
284284
expect(auto.name).toBe("Kilo: Auto");
285-
expect(auto.cost.input).toBeCloseTo(5.0);
285+
expect(auto.cost.input).toBeCloseTo(5);
286286
expect(requireModelById(models, "anthropic/claude-sonnet-4").id).toBe(
287287
"anthropic/claude-sonnet-4",
288288
);

extensions/memory-core/src/memory/hybrid.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("memory hybrid helpers", () => {
5151
endLine: 4,
5252
source: "memory",
5353
snippet: "kw-b",
54-
textScore: 1.0,
54+
textScore: 1,
5555
},
5656
],
5757
});
@@ -62,9 +62,9 @@ describe("memory hybrid helpers", () => {
6262
expect(a?.score).toBeCloseTo(0.7 * 0.9);
6363
expect(a?.vectorScore).toBeCloseTo(0.9);
6464
expect(a?.textScore).toBe(0);
65-
expect(b?.score).toBeCloseTo(0.3 * 1.0);
65+
expect(b?.score).toBeCloseTo(0.3 * 1);
6666
expect(b?.vectorScore).toBe(0);
67-
expect(b?.textScore).toBeCloseTo(1.0);
67+
expect(b?.textScore).toBeCloseTo(1);
6868
});
6969

7070
it("mergeHybridResults prefers keyword snippet when ids overlap", async () => {
@@ -90,15 +90,15 @@ describe("memory hybrid helpers", () => {
9090
endLine: 2,
9191
source: "memory",
9292
snippet: "kw-a",
93-
textScore: 1.0,
93+
textScore: 1,
9494
},
9595
],
9696
});
9797

9898
expect(merged).toHaveLength(1);
9999
expect(merged[0]?.snippet).toBe("kw-a");
100-
expect(merged[0]?.score).toBeCloseTo(0.5 * 0.2 + 0.5 * 1.0);
100+
expect(merged[0]?.score).toBeCloseTo(0.5 * 0.2 + 0.5 * 1);
101101
expect(merged[0]?.vectorScore).toBeCloseTo(0.2);
102-
expect(merged[0]?.textScore).toBeCloseTo(1.0);
102+
expect(merged[0]?.textScore).toBeCloseTo(1);
103103
});
104104
});

extensions/memory-core/src/memory/mmr.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe("computeMMRScore", () => {
170170
expected: -0.5,
171171
},
172172
{ name: "lambda=0.5 mixed", relevance: 0.8, similarity: 0.6, lambda: 0.5, expected: 0.1 },
173-
{ name: "default lambda math", relevance: 1.0, similarity: 0.5, lambda: 0.7, expected: 0.55 },
173+
{ name: "default lambda math", relevance: 1, similarity: 0.5, lambda: 0.7, expected: 0.55 },
174174
] as const;
175175

176176
for (const testCase of cases) {
@@ -214,7 +214,7 @@ describe("mmrRerank", () => {
214214

215215
describe("lambda edge cases", () => {
216216
const diverseItems: MMRItem[] = [
217-
{ id: "1", score: 1.0, content: "apple banana cherry" },
217+
{ id: "1", score: 1, content: "apple banana cherry" },
218218
{ id: "2", score: 0.9, content: "apple banana date" },
219219
{ id: "3", score: 0.8, content: "elderberry fig grape" },
220220
];
@@ -247,7 +247,7 @@ describe("mmrRerank", () => {
247247
describe("diversity behavior", () => {
248248
it("promotes diverse results over similar high-scoring ones", () => {
249249
const items: MMRItem[] = [
250-
{ id: "1", score: 1.0, content: "machine learning neural networks" },
250+
{ id: "1", score: 1, content: "machine learning neural networks" },
251251
{ id: "2", score: 0.95, content: "machine learning deep learning" },
252252
{ id: "3", score: 0.9, content: "database systems sql queries" },
253253
{ id: "4", score: 0.85, content: "machine learning algorithms" },
@@ -263,7 +263,7 @@ describe("mmrRerank", () => {
263263

264264
it("handles items with identical content", () => {
265265
const items: MMRItem[] = [
266-
{ id: "1", score: 1.0, content: "identical content" },
266+
{ id: "1", score: 1, content: "identical content" },
267267
{ id: "2", score: 0.9, content: "identical content" },
268268
{ id: "3", score: 0.8, content: "different stuff" },
269269
];
@@ -276,7 +276,7 @@ describe("mmrRerank", () => {
276276

277277
it("handles all identical content gracefully", () => {
278278
const items: MMRItem[] = [
279-
{ id: "1", score: 1.0, content: "same" },
279+
{ id: "1", score: 1, content: "same" },
280280
{ id: "2", score: 0.9, content: "same" },
281281
{ id: "3", score: 0.8, content: "same" },
282282
];
@@ -290,7 +290,7 @@ describe("mmrRerank", () => {
290290
describe("tie-breaking", () => {
291291
it("uses original score as tiebreaker", () => {
292292
const items: MMRItem[] = [
293-
{ id: "1", score: 1.0, content: "unique content one" },
293+
{ id: "1", score: 1, content: "unique content one" },
294294
{ id: "2", score: 0.9, content: "unique content two" },
295295
{ id: "3", score: 0.8, content: "unique content three" },
296296
];
@@ -327,7 +327,7 @@ describe("mmrRerank", () => {
327327
it("handles negative scores", () => {
328328
const items: MMRItem[] = [
329329
{ id: "1", score: -0.5, content: "hello world" },
330-
{ id: "2", score: -1.0, content: "foo bar" },
330+
{ id: "2", score: -1, content: "foo bar" },
331331
];
332332

333333
const result = mmrRerank(items, { lambda: 0.7 });
@@ -395,7 +395,7 @@ describe("applyMMRToHybridResults", () => {
395395
path: "/a.ts",
396396
startLine: 1,
397397
endLine: 10,
398-
score: 1.0,
398+
score: 1,
399399
snippet: "function add numbers together",
400400
source: "memory",
401401
},

extensions/minimax/speech-provider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe("buildMinimaxSpeechProvider", () => {
151151
model: "speech-01-240228",
152152
voiceId: "Chinese (Mandarin)_Warm_Girl",
153153
speed: 1.5,
154-
vol: 2.0,
154+
vol: 2,
155155
pitch: 3,
156156
},
157157
},
@@ -163,7 +163,7 @@ describe("buildMinimaxSpeechProvider", () => {
163163
expect(config.model).toBe("speech-01-240228");
164164
expect(config.voiceId).toBe("Chinese (Mandarin)_Warm_Girl");
165165
expect(config.speed).toBe(1.5);
166-
expect(config.vol).toBe(2.0);
166+
expect(config.vol).toBe(2);
167167
expect(config.pitch).toBe(3);
168168
});
169169

extensions/minimax/speech-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function parseDirectiveToken(ctx: SpeechDirectiveTokenParseContext): {
172172
return { handled: true };
173173
}
174174
const speed = Number(ctx.value);
175-
if (!Number.isFinite(speed) || speed < 0.5 || speed > 2.0) {
175+
if (!Number.isFinite(speed) || speed < 0.5 || speed > 2) {
176176
return { handled: true, warnings: [`invalid MiniMax speed "${ctx.value}" (0.5-2.0)`] };
177177
}
178178
return { handled: true, overrides: { speed } };

0 commit comments

Comments
 (0)