Skip to content

Commit

Permalink
lint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Mar 11, 2024
1 parent b3bec47 commit d612fdc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/vite/src/plugins/vite-plugin-rsc-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Plugin } from 'vite'
import { getPaths } from '@redwoodjs/project-config'

export function rscTransformPlugin(
clientEntryFiles: Record<string, string>
clientEntryFiles: Record<string, string>,
): Plugin {
return {
name: 'rsc-transform-plugin',
Expand Down Expand Up @@ -63,7 +63,7 @@ export function rscTransformPlugin(

if (useClient && useServer) {
throw new Error(
'Cannot have both "use client" and "use server" directives in the same file.'
'Cannot have both "use client" and "use server" directives in the same file.',
)
}

Expand All @@ -74,7 +74,7 @@ export function rscTransformPlugin(
code,
body,
id,
clientEntryFiles
clientEntryFiles,
)
} else {
transformedCode = transformServerModule(code, body, id)
Expand Down Expand Up @@ -246,7 +246,7 @@ function addExportNames(names: Array<string>, node: any) {
async function parseExportNamesIntoNames(
code: string,
body: any,
names: Array<string>
names: Array<string>,
): Promise<void> {
for (let i = 0; i < body.length; i++) {
const node = body[i]
Expand Down Expand Up @@ -308,7 +308,7 @@ async function transformClientModule(
code: string,
body: any,
url: string,
clientEntryFiles: Record<string, string>
clientEntryFiles: Record<string, string>,
): Promise<string> {
const names: Array<string> = []

Expand All @@ -319,7 +319,7 @@ async function transformClientModule(
// entryRecord will be undefined for dev, because clientEntryFiles will just
// be an empty object. See rscWorker.ts, where we do rscTransformPlugin({})
const entryRecord = Object.entries(clientEntryFiles).find(
([_key, value]) => value === url
([_key, value]) => value === url,
)

const loadId = entryRecord
Expand All @@ -342,7 +342,7 @@ async function transformClientModule(
url +
" from the server but it's on the client. It's not possible to " +
'invoke a client function from the server, it can only be ' +
'rendered as a Component or passed to props of a Client Component.'
'rendered as a Component or passed to props of a Client Component.',
) +
');'
} else {
Expand All @@ -357,7 +357,7 @@ async function transformClientModule(
name +
' is on the client. ' +
"It's not possible to invoke a client function from the server, it can " +
'only be rendered as a Component or passed to props of a Client Component.'
'only be rendered as a Component or passed to props of a Client Component.',
) +
');'
}
Expand Down

0 comments on commit d612fdc

Please sign in to comment.