119 const submitHandler = () => {
120 if (form.isValid()) {
121 const result = signUpAction.mutate(form.values)
122 console.log(result)123 }
124 }
125
241 form.setValues({ location: { city: result.city, govDist: result.govDist, country: result.country } })
242 },
243 })
244 console.log(form.values)245 return (
246 <Autocomplete
247 itemComponent={SelectItemSingleLine}
249 data={form.values.locationOptions}
250 label={t('current-location')}
251 onItemSubmit={(e) => {
252 console.log(e)253 setLocationSearch(e.placeId)
254 }}
255 {...form.getInputProps('searchLocation')}
31 const loginHandle = async (email: string, password: string) => {
32 if (!form.isValid()) return
33 const result = await signIn('cognito', { email, password, redirect: false })
34 if (result?.error) console.log(result) 35 }
36
37 return (
32 <Text variant={variants.Text.utility3}>{t('email-sent')}</Text>
33 </Group>
34 )
35 console.log('valid?', form.isValid())36 // TODO: Add 'shake' animation on invalid submit attempt
37 return (
38 <Stack align='center' spacing={24}>
36 const { classes } = useStyles()
37 const deleteAccount = async (email: string, password: string) => {
38 //TODO: [IN-784] add delete action here
39 console.log('called delete account')40 }
41
42 return (
27// TODO: [IN-786] Associate ActionButton click actions
28const actions = {
29 delete: () => {
30 console.log('delete') 31 },
32 more: () => {
33 console.log('more')
51 console.log('create new list')
52 },
53 saveToList: () => {
54 console.log('save to existing list') 55 },
56} as const
57
48 console.log('share')
49 },
50 saveNew: () => {
51 console.log('create new list') 52 },
53 saveToList: () => {
54 console.log('save to existing list')
45 console.log('unsave')
46 },
47 share: () => {
48 console.log('share') 49 },
50 saveNew: () => {
51 console.log('create new list')
39 console.log('review')
40 },
41 save: () => {
42 console.log('save') 43 },
44 saved: () => {
45 console.log('unsave')
36 window.print()
37 },
38 review: () => {
39 console.log('review') 40 },
41 save: () => {
42 console.log('save')
30 console.log('delete')
31 },
32 more: () => {
33 console.log('more') 34 },
35 print: () => {
36 window.print()
42 console.log('save')
43 },
44 saved: () => {
45 console.log('unsave') 46 },
47 share: () => {
48 console.log('share')
59 console.log(`Files to process:\n- ${files.join('\n- ')}`)
60
61 for (const file of files) {
62 console.log(`Generating types for: ${file}`)63 await quicktypeJSON(`${path.basename(file)}Collection`, file)
64 }
65}
56const generateTypes = async () => {
57 /** Relative to where `package.json` is */
58 const files = (await recursive(`${datastore}/output`)).filter((file) => path.extname(file) === '.json')
59 console.log(`Files to process:\n- ${files.join('\n- ')}`)60
61 for (const file of files) {
62 console.log(`Generating types for: ${file}`)
10 padding: 1,
11})
12
13console.log(message)
13 }
14)
15
16console.log(message)
47
48/** @type {import('@weareinreach/i18next-keys-ondemand').TranslationGetter} */
49const onDemandFetcher = async (keys, lang, ns, defaultValues) => {
50 console.log('fetcher called', { keys, lang, ns, defaultValues }) 51 try {
52 const { data } = await axios.post(getUrl('/api/i18n/get'), { keys, lang, ns, defaultValues })
53 const translations = Keys.parse(data)
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.
Bad Practice
if (!secure(data)) {
console.log("data is not secure", data) // `data` is visible to the client
}
console.table(tableObj)
Recommended
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.