console
in code that runs on browser JS-0002323 }
324 // eslint-disable-next-line react-hooks/exhaustive-deps
325 }, [form.values.supplement])
326 console.log(form.values)327 const needsSupplement = Object.values(supplements).includes(true)
328 return (
329 <>
221 (requireText && text) ||
222 (requireData && data)
223 ) {
224 console.log('handler after supp')225 const { value, label, icon, iconBg, variant, tKey } = item
226 setSupplements(supplementFields)
227 form.setValues({
212 if (!item) return
213 const { requireBoolean, requireGeo, requireData, requireLanguage, requireText } = item
214 const { boolean, countryId, govDistId, languageId, text, data } = e ?? {}
215 console.log('🚀 ~ file: index.tsx:219 ~ handleSupplement ~ e:', e)216
217 if (
218 (requireBoolean && boolean !== undefined) ||
176 /** Handle if supplemental info is provided */
177
178 // if (!form.values.supplement) {
179 console.log('init supp handler', item)180 const suppRequired: SupplementFieldsNeeded = {
181 boolean: requireBoolean ?? false,
182 geo: requireGeo ?? false,
171 const { requireBoolean, requireGeo, requireData, requireLanguage, requireText } = item
172 /** Check if supplemental info required */
173 if (requireBoolean || requireGeo || requireData || requireLanguage || requireText) {
174 console.log('eval handler', form.values.supplement)175 // const { boolean, countryId, govDistId, languageId, text, data } = form.values.supplement ?? {}
176 /** Handle if supplemental info is provided */
177
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.
Alternatively, you can silence this issue for your repository as shown here.
If a specific console
call is meant to stay for other reasons, you can add a skipcq comment to that line.
This will inform other developers about the reason behind the log's presence, and prevent DeepSource from flagging it.
Usually, console
methods are only used for debugging, and can leak internal info to the client.
Removing the console
call will fix this issue.
if (!secure(data)) {
console.log("data is not secure", data) // `data` is visible to the client
}
console.table(tableObj)
if (!secure(data)) {
// alter the DOM to inform the user that `data` is insecure.
}
console.table(tableObj) // skipcq: JS-0002 Easter egg. Users are meant to see this.