weareinreach / InReach

Found unused expressions in TypeScript code JS-0354
Bug risk
Minor
20 days ago2 years old
Expected an assignment or function call and instead saw an expression
18
19const postgresLocalUrlRegex = /^postgres:\/\/(?:([^:]+):([^@]+)@)?(?:localhost|127\.0\.0\.1)(:\d+)?\/([^?]+)/
20
21yargs(hideBin(process.argv))22	.demandCommand(1)23	.command(24		'up',25		'Start docker containers',26		() => {},27		async () => {28			if (process.env.DATABASE_URL && postgresLocalUrlRegex.test(process.env.DATABASE_URL)) {29				console.log("Starting docker...")30				await compose.upAll({31					config: dockerComposeFile,32					callback: (chunk) => console.log(chunk.toString()),33				})34			} else {35				console.log("Skipping docker start, DATABASE_URL is not set to a local address")36			}37		}38	)39	.command(40		'down',41		'Stop docker containers',42		() => {},43		async () => {44			try {45				await compose.ps({ config: dockerComposeFile })4647				await compose.downAll({48					config: dockerComposeFile,49					callback: (chunk) => console.log(chunk.toString()),50				})51			} catch (err) {52				if (err instanceof Error) {53					console.error(err.message)54				}55			}56		}57	).argv