From 1c4db989d477a8ff2f15d8a09715373bb55c699a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:20:19 +0000 Subject: [PATCH] refactor: remove the console expressions It is considered a best practice to avoid the use of any `console` methods in JavaScript code that will run on the browser. **NOTE:** If your repository contains a server side project, you can add `"nodejs"` to the `environment` property of analyzer meta in `.deepsource.toml`. This will prevent this issue from getting raised. Documentation for the analyzer meta can be found [here](https://docs.deepsource.com/docs/analyzers-javascript#meta). Alternatively, you can silence this issue for your repository [as shown here](https://deepsource.com/blog/releases-issue-actions). If a specific `console` call is meant to stay for other reasons, you can add [a skipcq comment](https://docs.deepsource.com/docs/issues-ignore-rules#silencing-a-specific-issue) to that line. This will inform other developers about the reason behind the log's presence, and prevent DeepSource from flagging it. --- javascript/npm/index.js | 2 -- javascript/pnpm/index.js | 2 -- javascript/yarn/index.js | 1 - 3 files changed, 5 deletions(-) diff --git a/javascript/npm/index.js b/javascript/npm/index.js index 32ac8a5..5ea7e09 100644 --- a/javascript/npm/index.js +++ b/javascript/npm/index.js @@ -7,8 +7,6 @@ const io = new Server(3000); function fetchDataAndEmit(socket) { axios.get('https://jsonplaceholder.typicode.com/todos/1') .then((response) => { - console.log('API response:', response.data); - // Send the API response back to the client socket.emit('apiResponse', response.data); }) diff --git a/javascript/pnpm/index.js b/javascript/pnpm/index.js index 32ac8a5..5ea7e09 100644 --- a/javascript/pnpm/index.js +++ b/javascript/pnpm/index.js @@ -7,8 +7,6 @@ const io = new Server(3000); function fetchDataAndEmit(socket) { axios.get('https://jsonplaceholder.typicode.com/todos/1') .then((response) => { - console.log('API response:', response.data); - // Send the API response back to the client socket.emit('apiResponse', response.data); }) diff --git a/javascript/yarn/index.js b/javascript/yarn/index.js index 32ac8a5..3b27fab 100644 --- a/javascript/yarn/index.js +++ b/javascript/yarn/index.js @@ -7,7 +7,6 @@ const io = new Server(3000); function fetchDataAndEmit(socket) { axios.get('https://jsonplaceholder.typicode.com/todos/1') .then((response) => { - console.log('API response:', response.data); // Send the API response back to the client socket.emit('apiResponse', response.data);