Ulf Gebhardt f782032563
refactor(backend): lint - import/order (#8350)
* lint - import/no-relative-parent-imports

fix build error

* fix md

* lint import/order

enabled rule import/order and fixed impot order in each file
2025-04-09 09:44:48 +02:00

21 lines
692 B
TypeScript

/* eslint-disable n/no-process-exit */
import CONFIG from '@config/index'
import { cleanDatabase } from './factories'
if (CONFIG.PRODUCTION && !CONFIG.PRODUCTION_DB_CLEAN_ALLOW) {
throw new Error(`You cannot clean the database in a non-staging and real production environment!`)
}
;(async function () {
try {
await cleanDatabase()
console.log('Successfully deleted all nodes and relations!') // eslint-disable-line no-console
process.exit(0)
// eslint-disable-next-line no-catch-all/no-catch-all
} catch (err) {
console.log(`Error occurred deleting the nodes and relations (reset the db)\n\n${err}`) // eslint-disable-line no-console
process.exit(1)
}
})()