Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(eslint rule and subsequent changes to the codebase): eslint rule …
Browse files Browse the repository at this point in the history
…no-console added

added eslint rule no-console to throw errors whenever calls to the console object are made and
subsequently removed all calls OR allowed them on file level for specific cases

fix #2307
  • Loading branch information
tobireuen committed Aug 20, 2020
1 parent 6434fd0 commit 6d9ca06
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
'no-param-reassign': ['error', { props: false }],
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'no-console': 'off',
'no-console': 'error',
'eol-last': ['error', 'always'],
'no-debugger': 'error',
'no-nested-ternary': 'off',
Expand Down
3 changes: 3 additions & 0 deletions couchdb-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/zsh

docker-compose down -v --rmi all --remove-orphans
3 changes: 3 additions & 0 deletions couchdb-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/zsh

docker-compose up --build -d
2 changes: 2 additions & 0 deletions scripts/check-translations/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import chalk from 'chalk'
import { ResourceKey } from 'i18next'

Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import { Spinner } from '@hospitalrun/components'
import React, { Suspense, useEffect, useState } from 'react'
import { ReactQueryDevtools } from 'react-query-devtools'
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/incidents/hooks/useReportIncident.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import { subDays } from 'date-fns'
import shortid from 'shortid'

Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/incidents/report/ReportIncident.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import { Button } from '@hospitalrun/components'
import { mount, ReactWrapper } from 'enzyme'
import { createMemoryHistory } from 'history'
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/patients/allergies/NewAllergyModal.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import { Modal, Alert } from '@hospitalrun/components'
import { mount } from 'enzyme'
import React from 'react'
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/patients/hooks/useAddAllergy.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-console */

import useAddAllergy from '../../../patients/hooks/useAddAllergy'
import * as validateAllergy from '../../../patients/util/validate-allergy'
import PatientRepository from '../../../shared/db/PatientRepository'
Expand Down
9 changes: 1 addition & 8 deletions src/shared/config/pouchdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ if (process.env.NODE_ENV === 'test') {
})

localDb = new PouchDB('local_hospitalrun')
localDb
.sync(serverDb, { live: true, retry: true })
.on('change', (info) => {
console.log(info)
})
.on('error', (info) => {
console.error(info)
})
localDb.sync(serverDb, { live: true, retry: true })
}

export const schema = [
Expand Down

0 comments on commit 6d9ca06

Please sign in to comment.