Skip to content

Commit 811a351

Browse files
committed
style: auto-format codebase and fix ESLint errors
Run prettier, ruff-format, and eslint on all files with the updated configuration: - 686 files reformatted by prettier and ruff-format - Fix ESLint errors in JS files newly covered by expanded ES module patterns: remove unused imports/variables, initialize variables on declaration, use empty catch blocks
1 parent 0289861 commit 811a351

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

spp_cel_widget/static/src/js/cel_symbol_service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const symbolCache = new Map();
2020
export const celSymbolService = {
2121
dependencies: [],
2222

23-
start(env) {
23+
start(/* env */) {
2424
return {
2525
/**
2626
* Get symbols for a profile

spp_gis/static/src/js/views/gis/gis_renderer/gis_renderer.esm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class GisRenderer extends Component {
127127
_matchesDomain(values, domain) {
128128
if (!domain) return true;
129129

130-
let domainArray;
130+
let domainArray = null;
131131
try {
132132
domainArray = typeof domain === "string" ? JSON.parse(domain) : domain;
133133
} catch {
@@ -676,7 +676,7 @@ export class GisRenderer extends Component {
676676
const opacity = Math.min(1, Math.max(0, layer.layer_opacity));
677677

678678
// Determine fill/stroke color based on layer type
679-
let fillColor;
679+
let fillColor = null;
680680
let isChoropleth = false;
681681

682682
if (layer.source_type === "report" && layer.report_features) {
@@ -891,7 +891,7 @@ export class GisRenderer extends Component {
891891
}
892892

893893
// Determine color based on layer type
894-
let fillColor;
894+
let fillColor = null;
895895
if (layer.source_type === "report" && layer.report_features) {
896896
// Report layers: use pre-computed report_color
897897
fillColor = ["coalesce", ["get", "report_color"], "#cccccc"];

spp_programs/static/src/js/cel_builder_wizard.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ patch(FormController.prototype, {
9494
this._examplesObserver = new MutationObserver((mutations) => {
9595
for (const mutation of mutations) {
9696
if (mutation.addedNodes.length) {
97-
const hasExamples = Array.from(mutation.addedNodes).some((node) => {
97+
Array.from(mutation.addedNodes).some((node) => {
9898
return (
9999
node.nodeType === 1 &&
100100
(node.classList?.contains("cel-examples") ||
@@ -145,7 +145,7 @@ patch(FormController.prototype, {
145145
// Determine new value:
146146
// - If field is empty, just set the expression
147147
// - If field has content, combine with AND operator
148-
let newValue;
148+
let newValue = "";
149149
if (currentValue.trim()) {
150150
// Wrap existing expression in parentheses if it doesn't have them
151151
const wrappedCurrent =
@@ -187,11 +187,11 @@ patch(FormController.prototype, {
187187
await this.model.root.update({
188188
cel_expression: newValue,
189189
});
190-
} catch (e) {
190+
} catch {
191191
// Model update not needed
192192
}
193193
}
194-
} catch (error) {
194+
} catch {
195195
// Silently handle errors
196196
}
197197
},

spp_registry/static/src/js/form_text_overflow.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/** @odoo-module **/
22

3-
import {Component, onMounted, useEffect, useRef} from "@odoo/owl";
4-
import {registry} from "@web/core/registry";
3+
import {onMounted} from "@odoo/owl";
54
import {FormController} from "@web/views/form/form_controller";
65
import {patch} from "@web/core/utils/patch";
76

spp_studio/static/src/js/logic_editor/test_panel_field.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class TestPanelField extends Component {
2828
loading: false,
2929
});
3030

31-
onWillUpdateProps(async (nextProps) => {
31+
onWillUpdateProps(async () => {
3232
// Handle prop updates if needed
3333
});
3434
}
@@ -74,7 +74,7 @@ export class TestPanelField extends Component {
7474
this.state.loading = true;
7575
try {
7676
// Call the action_run_test method on the test record
77-
const result = await this.orm.call("spp.studio.test", "action_run_test", [
77+
await this.orm.call("spp.studio.test", "action_run_test", [
7878
[testId],
7979
]);
8080

@@ -106,7 +106,7 @@ export class TestPanelField extends Component {
106106
this.state.loading = true;
107107
try {
108108
// Call the action_test_all method on the logic record
109-
const result = await this.orm.call("spp.logic", "action_test_all", [
109+
await this.orm.call("spp.logic", "action_test_all", [
110110
[this.logicId],
111111
]);
112112

0 commit comments

Comments
 (0)