Skip to content

Commit

Permalink
refactor: replace template strings with regular string literals (#1202)
Browse files Browse the repository at this point in the history
* refactor: replace template strings with regular string literals

Template literals are useful when you need:  1. [Interpolated strings](https://en.wikipedia.org/wiki/String_interpolation).

* chore: lint & format

Signed-off-by: InReach [bot] <[email protected]>

---------

Signed-off-by: InReach [bot] <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: InReach [bot] <[email protected]>
  • Loading branch information
deepsource-autofix[bot] and InReach-svc authored Apr 3, 2024
1 parent 34a6054 commit 0726674
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docker/docker-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ yargs(hideBin(process.argv))
() => {},
async () => {
if (process.env.DATABASE_URL && postgresLocalUrlRegex.test(process.env.DATABASE_URL)) {
console.log(`Starting docker...`)
console.log("Starting docker...")
await compose.upAll({
config: dockerComposeFile,
callback: (chunk) => console.log(chunk.toString()),
})
} else {
console.log(`Skipping docker start, DATABASE_URL is not set to a local address`)
console.log("Skipping docker start, DATABASE_URL is not set to a local address")
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion lambdas/cognito-messaging/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const clientMetadataDefaults = (triggerSource: CustomMessageTriggerEvent['trigge
const resetPw = triggerSource === 'CustomMessage_ForgotPassword'

return {
baseUrl: `https://app.inreach.org`,
baseUrl: 'https://app.inreach.org',
subject: resetPw ? 'Reset your password' : 'Confirm your account',
message: resetPw
? 'Click the following link to reset your password:'
Expand Down
2 changes: 1 addition & 1 deletion lambdas/cognito-user-migrate/src/getUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getUser: GetUser = async (email) => {
} catch (error) {
if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === 'P2025') {
logger.error(`User not found: ${email}`)
throw new Error(`User not found`)
throw new Error('User not found')
}
throw error
}
Expand Down
2 changes: 1 addition & 1 deletion lib/devmsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import boxen from 'boxen'

const message = boxen(
`The following dev commands are available:\n\n- pnpm dev:app InReach App\n- pnpm dev:web InReach Main Website\n- pnpm dev:ui Storybook for UI elements\n- pnpm dev:all Run all in parallel`,
"The following dev commands are available:\n\n- pnpm dev:app InReach App\n- pnpm dev:web InReach Main Website\n- pnpm dev:ui Storybook for UI elements\n- pnpm dev:all Run all in parallel",
{
title: 'InReach dev Commands',
borderStyle: 'double',
Expand Down
2 changes: 1 addition & 1 deletion lib/runInstall.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-unused-modules */
import boxen from 'boxen'

const message = boxen(`There have been changes to package dependencies!\n\nRun 'pnpm install' to update.`, {
const message = boxen("There have been changes to package dependencies!\n\nRun 'pnpm install' to update.", {
title: 'New/Updated Packages',
borderStyle: 'double',
borderColor: 'redBright',
Expand Down
2 changes: 1 addition & 1 deletion packages/api/turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
actions: (data) => {
if (!data) throw new Error('No data')
data.isMutation = data.operation === 'mutation'
const basePath = `router/{{routerDir}}/{{operation}}.{{name}}`
const basePath = 'router/{{routerDir}}/{{operation}}.{{name}}'
const actions: PlopTypes.Actions = []

actions.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/db/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ prisma.$use(superjsonMiddleware)
const queryLogger = createPrismaQueryEventHandler({
queryDuration: true,
format: true,
indent: `\t`,
indent: '\t',
// linesBetweenQueries: 2,
language: 'pl/sql',
logger: (data) => log.info(`\n${data}`),
Expand Down
2 changes: 1 addition & 1 deletion packages/db/prisma/dataMigrationRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const jobs = new Listr<Context>(
task.output = `${jobNamesToRun.length} migrations to run:\n▸ ${jobNamesToRun.join('\n▸ ')}`
task.title = `Pending migrations: ${jobNamesToRun.length}`
} else {
task.title = `No pending migrations to apply.`
task.title = 'No pending migrations to apply.'
}
},

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/core/Donate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const useStyles = createStyles((theme) => ({
animation: `${bounce(16)} 1.75s 5`,
},
shrink: {
transition: `all 0.5s ease-in-out`,
transition: 'all 0.5s ease-in-out',
padding: '0 !important',
borderRadius: '100% !important',
width: rem(48),
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/core/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const useStyles = createStyles((theme) => ({
minWidth: 'fit-content',
},
pinToLeft: {
left: `0 !important`,
left: '0 !important',
},
}))

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/core/SearchDistance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ParamSchema = z.tuple([
z.coerce.number().gte(-180).lte(180).describe('longitude'),
z.coerce.number().gte(-90).lte(90).describe('latitude'),
z.coerce.number().describe('distance'),
z.literal('mi').or(z.literal('km')).describe(`'mi' or 'km'`),
z.literal('mi').or(z.literal('km')).describe("'mi' or 'km'"),
])

interface MarkItem {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/data-portal/AddressDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,15 @@ const _AddressDrawer = forwardRef<HTMLButtonElement, AddressDrawerProps>(({ loca
<Stack spacing={0} w='100%'>
<Text variant={variants.Text.utility1}>Show on org?</Text>
<Checkbox
label={`Show this location's address on the organiation page`}
label={"Show this location's address on the organiation page"}
classNames={{ label: classes.radioLabel }}
{...form.getInputProps('data.published', { type: 'checkbox' })}
/>
</Stack>
<Stack spacing={0} w='100%'>
<Text variant={variants.Text.utility1}>Mailing address only?</Text>
<Checkbox
label={`This is NOT a physical location`}
label={'This is NOT a physical location'}
classNames={{ label: classes.radioLabel }}
{...form.getInputProps('data.mailOnly', { type: 'checkbox' })}
/>
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/mockData/orgPhone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const orgPhone = {
get: getTRPCMock({
path: ['orgPhone', 'get'],
response: async () => {
const { default: data } = await import(`./json/orgPhone.get.json`)
const { default: data } = await import('./json/orgPhone.get.json')
return data
},
}),
Expand All @@ -25,7 +25,7 @@ export const orgPhone = {
path: ['orgPhone', 'forContactInfo'],
type: 'query',
response: async ({ locationOnly }) => {
const { default: data } = await import(`./json/orgPhone.forContactInfo.json`)
const { default: data } = await import('./json/orgPhone.forContactInfo.json')

return locationOnly !== undefined ? data.filter((record) => record.locationOnly === locationOnly) : data
},
Expand All @@ -34,15 +34,15 @@ export const orgPhone = {
path: ['orgPhone', 'forEditDrawer'],
type: 'query',
response: async () => {
const { default: data } = await import(`./json/orgPhone.forEditDrawer.json`)
const { default: data } = await import('./json/orgPhone.forEditDrawer.json')
return data
},
}),
forContactInfoEdit: getTRPCMock({
path: ['orgPhone', 'forContactInfoEdit'],
type: 'query',
response: async () => {
const { default: data } = await import(`./json/orgPhone.forContactInfoEdit.json`)
const { default: data } = await import('./json/orgPhone.forContactInfoEdit.json')
return data
},
}),
Expand Down
32 changes: 16 additions & 16 deletions packages/ui/theme/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { keyframes, rem } from '@mantine/core'

export const shake = {
1: keyframes({
'0%': { marginLeft: `0rem` },
'25%': { marginLeft: `0.5rem` },
'75%': { marginLeft: `-0.5rem` },
'100%': { marginLeft: `0rem` },
'0%': { marginLeft: '0rem' },
'25%': { marginLeft: '0.5rem' },
'75%': { marginLeft: '-0.5rem' },
'100%': { marginLeft: '0rem' },
}),
2: keyframes({
'0%': { transform: `translate(${rem(1)}, ${rem(1)}) rotate(0deg)` },
Expand All @@ -29,36 +29,36 @@ export const shake = {
'100%': { transform: `translate(${rem(1)}, ${rem(-2)}) rotate(-1deg)` },
}),
4: keyframes({
'0%, 100%': { transform: `translateX(0)` },
'0%, 100%': { transform: 'translateX(0)' },
'10%, 30%, 50%, 70%, 90%': { transform: `translateX(${rem(-10)})` },
'20%, 40%, 60%, 80%': { transform: `translateX(${rem(10)})` },
}),
5: keyframes({
'0%': { transform: `rotate(0deg)` },
'25%': { transform: `rotate(5deg)` },
'50%': { transform: `rotate(0eg)` },
'75%': { transform: `rotate(-5deg)` },
'100%': { transform: `rotate(0deg)` },
'0%': { transform: 'rotate(0deg)' },
'25%': { transform: 'rotate(5deg)' },
'50%': { transform: 'rotate(0eg)' },
'75%': { transform: 'rotate(-5deg)' },
'100%': { transform: 'rotate(0deg)' },
}),
6: keyframes({
'0%': { transform: `translateX(0)` },
'0%': { transform: 'translateX(0)' },
'25%': { transform: `translateX(${rem(5)})` },
'50%': { transform: `translateX(${rem(-5)})` },
'75%': { transform: `translateX(${rem(5)})` },
'100%': { transform: `translateX(0)` },
'100%': { transform: 'translateX(0)' },
}),
7: keyframes({
'0%': { transform: `translate(0, 0) rotate(0deg)` },
'0%': { transform: 'translate(0, 0) rotate(0deg)' },
'25%': { transform: `translate(${rem(5)}, ${rem(5)}) rotate(5deg)` },
'50%': { transform: `translate(0, 0) rotate(0eg)` },
'50%': { transform: 'translate(0, 0) rotate(0eg)' },
'75%': { transform: `translate(${rem(-5)}, ${rem(5)}) rotate(-5deg)` },
'100%': { transform: `translate(0, 0) rotate(0deg)` },
'100%': { transform: 'translate(0, 0) rotate(0deg)' },
}),
}

export const bounce = (distance: number) =>
keyframes({
'0%, 20%, 50%, 80%, 100%': { transform: `translateY(0)` },
'0%, 20%, 50%, 80%, 100%': { transform: 'translateY(0)' },
'40%': { transform: `translateY(${rem(-distance)})` },
'60%': { transform: `translateY(${rem(-distance / 2)})` },
})

0 comments on commit 0726674

Please sign in to comment.