From 60fa929fb764a4ac1210c69f4a3e4c9dbe63b022 Mon Sep 17 00:00:00 2001 From: MaxNumerique Date: Mon, 2 Mar 2026 16:41:33 +0100 Subject: [PATCH 01/15] fix(oxlint): complete oxlint addition. Strict file naming convention, props, imports --- .oxlintrc.json | 58 ++++++++++++++++--- app/components/DeleteDialog.vue | 2 +- app/components/DragAndDrop.vue | 13 +++-- app/components/GlassCard.vue | 8 +-- app/components/Launcher.vue | 2 +- app/components/ObjectSelector.vue | 2 +- app/components/PackagesVersions.vue | 2 +- app/components/RemoteRenderingView.vue | 2 +- app/components/Screenshot.vue | 4 +- app/components/SearchBar.vue | 2 +- app/components/Viewer/ContextMenuItem.vue | 2 +- .../Viewer/Options/ColorMapList.vue | 4 -- .../Viewer/Options/ColorMapPicker.vue | 6 +- app/components/Viewer/Options/TextureItem.vue | 4 +- .../Viewer/Options/TexturesSelector.vue | 8 +-- app/composables/project_manager.js | 2 - ...n_function_when_microservices_connected.js | 2 - app/stores/data.js | 18 +++--- app/stores/data_style.js | 6 +- app/stores/geode.js | 2 +- app/stores/hybrid_viewer.js | 4 +- app/stores/infra.js | 2 +- app/stores/lambda.js | 2 +- app/stores/viewer.js | 4 +- app/utils/colormap.js | 4 +- app/utils/local.js | 14 +++-- app/utils/status.js | 2 +- app/utils/upload_file.js | 4 +- app/utils/validate_schema.js | 4 +- internal/database/database.js | 21 +++++-- internal/stores/data_style/mesh/cells/cell.js | 2 +- .../stores/data_style/mesh/cells/vertex.js | 2 +- internal/stores/data_style/mesh/edges/edge.js | 4 +- .../stores/data_style/mesh/edges/vertex.js | 2 +- internal/stores/data_style/mesh/index.js | 2 +- .../stores/data_style/mesh/points/vertex.js | 2 +- .../data_style/mesh/polygons/polygon.js | 2 +- .../stores/data_style/mesh/polygons/vertex.js | 2 +- .../data_style/mesh/polyhedra/polyhedron.js | 2 +- .../data_style/mesh/polyhedra/vertex.js | 2 +- internal/stores/data_style/model/index.js | 2 +- internal/utils/api_fetch.js | 4 +- internal/utils/viewer_call.js | 4 +- tests/integration/setup.js | 2 +- .../stores/data_style/mesh/cells.nuxt.test.js | 2 +- .../stores/data_style/mesh/edges.nuxt.test.js | 2 +- .../stores/data_style/mesh/index.nuxt.test.js | 2 +- .../data_style/mesh/points.nuxt.test.js | 2 +- .../data_style/mesh/polygons.nuxt.test.js | 2 +- .../data_style/mesh/polyhedra.nuxt.test.js | 2 +- .../data_style/model/blocks.nuxt.test.js | 2 +- .../data_style/model/corners.nuxt.test.js | 2 +- .../data_style/model/edges.nuxt.test.js | 2 +- .../data_style/model/index.nuxt.test.js | 2 +- .../data_style/model/lines.nuxt.test.js | 2 +- .../data_style/model/points.nuxt.test.js | 2 +- .../data_style/model/surfaces.nuxt.test.js | 2 +- tests/integration/stores/viewer.nuxt.test.js | 2 +- .../unit/components/CrsSelector.nuxt.test.js | 4 +- .../components/ExtensionSelector.nuxt.test.js | 4 +- tests/unit/components/Launcher.nuxt.test.js | 2 +- ...t.test.js => project_manager.nuxt.test.js} | 0 ..._when_microservices_connected.nuxt.test.js | 4 +- .../unit/composables/upload_file.nuxt.test.js | 2 +- .../{App.nuxt.test.js => app.nuxt.test.js} | 2 - ...ack.nuxt.test.js => feedback.nuxt.test.js} | 12 ++-- ...{Geode.nuxt.test.js => geode.nuxt.test.js} | 4 +- ...{Infra.nuxt.test.js => infra.nuxt.test.js} | 2 +- ...ambda.nuxt.test.js => lambda.nuxt.test.js} | 2 +- ...iew.nuxt.test.js => treeview.nuxt.test.js} | 0 ...iewer.nuxt.test.js => viewer.nuxt.test.js} | 0 tests/unit/utils/validate_schema.nuxt.test.js | 2 +- vuetify_config.js | 2 +- 73 files changed, 183 insertions(+), 131 deletions(-) rename tests/unit/composables/{ProjectManager.nuxt.test.js => project_manager.nuxt.test.js} (100%) rename tests/unit/stores/{App.nuxt.test.js => app.nuxt.test.js} (98%) rename tests/unit/stores/{Feedback.nuxt.test.js => feedback.nuxt.test.js} (93%) rename tests/unit/stores/{Geode.nuxt.test.js => geode.nuxt.test.js} (99%) rename tests/unit/stores/{Infra.nuxt.test.js => infra.nuxt.test.js} (99%) rename tests/unit/stores/{Lambda.nuxt.test.js => lambda.nuxt.test.js} (98%) rename tests/unit/stores/{Treeview.nuxt.test.js => treeview.nuxt.test.js} (100%) rename tests/unit/stores/{Viewer.nuxt.test.js => viewer.nuxt.test.js} (100%) diff --git a/.oxlintrc.json b/.oxlintrc.json index a033f40f..e0a7a0d0 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -7,7 +7,7 @@ "style": "error", "restriction": "error" }, - "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"], + "plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest", "vue"], "rules": { "unicorn/filename-case": [ "error", @@ -15,26 +15,66 @@ "case": "snakeCase" } ], - "eslint/func-style": [ + "eslint/func-style": ["error", "declaration"], + "eslint/sort-keys": "off", + "eslint/no-ternary": "off", // A utiliser pour des opérations simples + "oxc/no-async-await": "off", + "oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed + "eslint/max-statements": ["warn", 20], + "eslint/id-length": ["error", { "exceptions": ["x", "y", "z", "i", "j", "k", "r", "g", "b", "id", "ID"], "min": 3 }], + "eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs + "sort-imports": ["error", { "allowSeparatedGroups": true }], + "eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison + "import/prefer-default-export": "off", + "import/no-named-export": "off", + "import/no-namespace": ["error", { "ignore": ["vuetify/*"] }], + "vue/max-props": ["error", { "maxProps": 7 }], + "oxc/no-optional-chaining": "off", + "node/no-process-env": "off", + "capitalized-comments": "warn", + "no-continue": "off", + "max-params": ["warn", { "max": 4 }], + "eslint/no-magic-numbers": [ "error", { - "style:": "declaration" + "ignore": [-1, 0, 1, 2, 4], + "ignoreArrayIndexes": true } ], - "eslint/sort-keys": "off", - "eslint/no-ternary": "off" + "vitest/require-hook": "off" }, "overrides": [ { - "files": ["**/components/*"], + "files": ["**/*.vue", "tests/unit/components/**"], "rules": { "unicorn/filename-case": [ "error", { - "case": "PascalCase" + "case": "pascalCase" } - ] + ], + "import/unambiguous": "warn" + } + }, + { + "files": [ + "app/plugins/**", + "node_scripts/**", + "server/**", + "*.config.js", ], + "rules": { + "import/no-default-export": "off", + "unicorn/prefer-structured-clone": "off", + "unicorn/require-post-message-target-origin": "off" + } + }, + { + "files": ["tests/**"], + "rules": { + "vitest/require-hook": "off", + "eslint/init-declarations": "off", + "vitest/require-top-level-describe": "off" } } ] -} +} \ No newline at end of file diff --git a/app/components/DeleteDialog.vue b/app/components/DeleteDialog.vue index 9a895cbe..2533aa5d 100644 --- a/app/components/DeleteDialog.vue +++ b/app/components/DeleteDialog.vue @@ -8,7 +8,7 @@ }, item: { type: Object, - default: null, + default: undefined, }, selectedCount: { type: Number, diff --git a/app/components/DragAndDrop.vue b/app/components/DragAndDrop.vue index 547ce722..a9bdb0dc 100644 --- a/app/components/DragAndDrop.vue +++ b/app/components/DragAndDrop.vue @@ -1,14 +1,11 @@