From 5ecc4ff6159b3a150352dcc579ebb2c06a02a7f8 Mon Sep 17 00:00:00 2001 From: Cyril Beslay Date: Tue, 6 Feb 2024 18:10:04 +0100 Subject: [PATCH] Eslint front: Add no-console rule + clean (#2023) --- front/.eslintrc.json | 3 ++- front/src/components/boxs/camera/Camera.jsx | 3 --- front/src/components/boxs/camera/EditCamera.jsx | 1 - front/src/components/boxs/room-temperature/RoomTemperature.jsx | 2 -- .../src/routes/integration/all/zwavejs-ui/setup-page/index.js | 1 - front/src/routes/scene/edit-scene/index.js | 1 - 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/front/.eslintrc.json b/front/.eslintrc.json index 8c7d3048c0..40b29ddacf 100644 --- a/front/.eslintrc.json +++ b/front/.eslintrc.json @@ -26,7 +26,8 @@ "selector": "CallExpression[callee.object.name='store'][callee.property.name='setState']", "message": "Usage of unistore is not recommended anymore, please use local states instead." } */ - ] + ], + "no-console": ["error", { "allow": ["error"] }] }, "env": { "browser": true diff --git a/front/src/components/boxs/camera/Camera.jsx b/front/src/components/boxs/camera/Camera.jsx index 20e5254695..fddd2349b4 100644 --- a/front/src/components/boxs/camera/Camera.jsx +++ b/front/src/components/boxs/camera/Camera.jsx @@ -137,9 +137,6 @@ class CameraBoxComponent extends Component { } }); this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {}); - this.hls.on(Hls.Events.MANIFEST_PARSED, (event, data) => { - console.log(`manifest loaded, found ${data.levels.length} quality level`); - }); this.hls.on(Hls.Events.ERROR, (event, data) => { console.error(event, data); const errorType = data.type; diff --git a/front/src/components/boxs/camera/EditCamera.jsx b/front/src/components/boxs/camera/EditCamera.jsx index 18d2ef31e7..d1dd9369dd 100644 --- a/front/src/components/boxs/camera/EditCamera.jsx +++ b/front/src/components/boxs/camera/EditCamera.jsx @@ -104,7 +104,6 @@ class EditCameraBoxComponent extends Component { updateCameraLiveAutoStart = e => { const newValue = e.target.checked; - console.log({ newValue }); this.props.updateBoxConfig(this.props.x, this.props.y, { camera_live_auto_start: newValue }); diff --git a/front/src/components/boxs/room-temperature/RoomTemperature.jsx b/front/src/components/boxs/room-temperature/RoomTemperature.jsx index db0dd46c91..1f8ee1c82d 100644 --- a/front/src/components/boxs/room-temperature/RoomTemperature.jsx +++ b/front/src/components/boxs/room-temperature/RoomTemperature.jsx @@ -106,8 +106,6 @@ class RoomTemperatureBoxComponent extends Component { temperature_max = DEFAULT_VALUE_TEMPERATURE.MAXIMUM; } - console.log('unit', unit); - if (unit === DEVICE_FEATURE_UNITS.FAHRENHEIT) { temperature_min = celsiusToFahrenheit(temperature_min); temperature_max = celsiusToFahrenheit(temperature_min); diff --git a/front/src/routes/integration/all/zwavejs-ui/setup-page/index.js b/front/src/routes/integration/all/zwavejs-ui/setup-page/index.js index 8521e3eca8..4c14a01a49 100644 --- a/front/src/routes/integration/all/zwavejs-ui/setup-page/index.js +++ b/front/src/routes/integration/all/zwavejs-ui/setup-page/index.js @@ -69,7 +69,6 @@ class DiscoverTab extends Component { await this.setState({ loading: true }); await this.getStatus(); await this.getConfiguration(); - console.log('Finish init'); await this.setState({ loading: false }); }; diff --git a/front/src/routes/scene/edit-scene/index.js b/front/src/routes/scene/edit-scene/index.js index 406bcafa1a..bd28bd0edf 100644 --- a/front/src/routes/scene/edit-scene/index.js +++ b/front/src/routes/scene/edit-scene/index.js @@ -336,7 +336,6 @@ class EditScene extends Component { }; updateSceneIcon = e => { - console.log('updateSceneIcon', e.target.value); this.setState(prevState => { const newState = update(prevState, { scene: {