Skip to content

Commit

Permalink
Add names for default exported functions
Browse files Browse the repository at this point in the history
This should work around the issue in eslint-plugin-react 7.20.4 [1], and
is good practice in any case.

[1] jsx-eslint/eslint-plugin-react#2728
  • Loading branch information
sluukkonen committed Jul 27, 2020
1 parent 53931c7 commit 28eea3e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/create-mex.ts
Expand Up @@ -4,7 +4,7 @@ import path from 'path'
import * as uuid from 'uuid'
import { examName } from '../utils'

export default async function ({
export default async function createMexExam({
exam,
outdir = path.dirname(exam),
nsaScripts,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/create-offline.ts
Expand Up @@ -2,7 +2,7 @@ import { createOfflineExam } from '@digabi/exam-engine-rendering'
import { Ora } from 'ora'
import path from 'path'

export default async function ({
export default async function createOffline({
exam,
outdir = path.dirname(exam),
media,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/create-transfer-zip.ts
Expand Up @@ -8,7 +8,7 @@ import * as uuid from 'uuid'
import yazl from 'yazl'
import { examName } from '../utils'

export default async function ({
export default async function createTransferZip({
exam,
outdir = path.dirname(exam),
spinner,
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/new.ts
Expand Up @@ -2,7 +2,7 @@ import { promises as fs } from 'fs'
import { Ora } from 'ora'
import path from 'path'

export default async function ({ directory }: { directory: string; spinner: Ora }): Promise<string> {
export default async function newExam({ directory }: { directory: string; spinner: Ora }): Promise<string> {
const resolveExamFile = (...file: string[]) => path.resolve(directory, ...file)

await assertDirectoryDoesNotExist(directory)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/preview.ts
@@ -1,7 +1,7 @@
import { previewExam } from '@digabi/exam-engine-rendering'
import { Ora } from 'ora'

export default async function ({ exam, spinner }: { exam: string; spinner: Ora }): Promise<string> {
export default async function preview({ exam, spinner }: { exam: string; spinner: Ora }): Promise<string> {
spinner.start(`Previewing ${exam}...`)
const ctx = await previewExam(exam, { openFirefox: true })
spinner.info(`Server is running at ${ctx.url}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/rendering/src/exam-loader.ts
Expand Up @@ -11,7 +11,7 @@ function stringifyModule(module: any, attachments: Attachment[] = []): string {
return imports + '\nmodule.exports = ' + JSON.stringify(module)
}

export default async function (this: webpack.loader.LoaderContext, source: string): Promise<void> {
export default async function examLoader(this: webpack.loader.LoaderContext, source: string): Promise<void> {
const callback = this.async()!
const baseDir = path.dirname(this.resourcePath)
const resolveAttachment = (attachment: string) => path.resolve(baseDir, 'attachments', attachment)
Expand Down

0 comments on commit 28eea3e

Please sign in to comment.