Skip to content

Commit 26ff217

Browse files
authored
Merge pull request #438 from Geode-solutions/fix/oxlint-no-sync
fix(oxlint): Math.trunc()
2 parents 2c171c4 + c6a6741 commit 26ff217

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.oxlintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"no-continue": "off",
8080
"vitest/require-hook": "off",
8181
"import/unambiguous": "off",
82+
"node/no-sync": "off",
8283
"max-params": [
8384
"warn",
8485
{

app/composables/hover_highlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function useHoverhighlight() {
2828
}
2929

3030
block_ids = (Array.isArray(block_ids) ? block_ids : [])
31-
.map((blockId) => Number.parseInt(blockId, 10))
31+
.map((blockId) => Math.trunc(Number(blockId)))
3232
.filter((blockId) => !Number.isNaN(blockId));
3333

3434
if (currentId !== id) {

app/stores/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ export const useDataStore = defineStore("data", () => {
178178

179179
async function getAllModelComponentsViewerIds(modelId) {
180180
const components = await model_components_db.where("id").equals(modelId).toArray();
181-
return components.map((component) => Number.parseInt(component.viewer_id, 10));
181+
return components.map((component) => Math.trunc(Number(component.viewer_id)));
182182
}
183183

184184
async function getMeshComponentsViewerIds(modelId, meshComponentGeodeIds) {
185185
const components = await model_components_db
186186
.where("[id+geode_id]")
187187
.anyOf(meshComponentGeodeIds.map((geode_id) => [modelId, geode_id]))
188188
.toArray();
189-
return components.map((component) => Number.parseInt(component.viewer_id, 10));
189+
return components.map((component) => Math.trunc(Number(component.viewer_id)));
190190
}
191191

192192
async function exportStores() {

0 commit comments

Comments
 (0)