diff --git a/src/commands/qrcode/qrcode.ts b/src/commands/qrcode/qrcode.ts index 4fd4170..340a342 100644 --- a/src/commands/qrcode/qrcode.ts +++ b/src/commands/qrcode/qrcode.ts @@ -1,5 +1,5 @@ import { CATEGORIES } from '../../config/categories'; -import { CreateQrCode } from '../../types'; +import type { CreateQrCode } from '../../types'; import { writeFile } from '../../utils/file'; import { composeQrCode, composeSetupUri } from './qrcode.utils'; @@ -15,6 +15,7 @@ export const createQrCode = async ({ category, flag, name, output, pairingCode, try { await writeFile({ name, output, svg, ...rest }); + // eslint-disable-next-line no-console console.log(`HomeKit QR Code successfully generated: ${name}.${output}`); } catch (error) { console.error(error); diff --git a/src/commands/qrcode/qrcode.utils.ts b/src/commands/qrcode/qrcode.utils.ts index 99a677e..e663142 100644 --- a/src/commands/qrcode/qrcode.utils.ts +++ b/src/commands/qrcode/qrcode.utils.ts @@ -1,5 +1,6 @@ -import { QRCodeToStringOptions, toString } from 'qrcode'; -import { ComposeQrCode, ComposeSetupUri } from '../../types'; +import type { QRCodeToStringOptions } from 'qrcode'; +import { toString } from 'qrcode'; +import type { ComposeQrCode, ComposeSetupUri } from '../../types'; const QR_CODE_STRING_OPTIONS: QRCodeToStringOptions = { errorCorrectionLevel: 'quartile', diff --git a/src/commands/tag/tag.ts b/src/commands/tag/tag.ts index 15dabdc..db61b68 100644 --- a/src/commands/tag/tag.ts +++ b/src/commands/tag/tag.ts @@ -1,4 +1,4 @@ -import { CreateTag } from '../../types'; +import type { CreateTag } from '../../types'; import { writeFile } from '../../utils/file'; import { composeTag } from './tag.utils'; @@ -7,6 +7,7 @@ export const createTag = async ({ name, output, pairingCode, ...rest }: CreateTa try { await writeFile({ name, output, svg, ...rest }); + // eslint-disable-next-line no-console console.log(`HomeKit tag successfully generated: ${name}.${output}`); } catch (error) { console.error(error); diff --git a/src/types/index.ts b/src/types/index.ts index df30ba8..4215fdc 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,5 +1,5 @@ -import { CATEGORIES } from '../config/categories'; -import { OUTPUT_FORMATS } from '../config/output'; +import type { CATEGORIES } from '../config/categories'; +import type { OUTPUT_FORMATS } from '../config/output'; export type Category = keyof typeof CATEGORIES; diff --git a/src/utils/file.ts b/src/utils/file.ts index 4d69266..a43c258 100644 --- a/src/utils/file.ts +++ b/src/utils/file.ts @@ -1,5 +1,5 @@ import fs from 'fs'; -import { CreateFileBuffer, WriteFile } from '../types'; +import type { CreateFileBuffer, WriteFile } from '../types'; import { createImage } from './image'; const createFileBuffer = async ({ output, svg, zoom }: CreateFileBuffer): Promise => { diff --git a/src/utils/image.ts b/src/utils/image.ts index 62fb31c..97b7899 100644 --- a/src/utils/image.ts +++ b/src/utils/image.ts @@ -1,5 +1,5 @@ import { Resvg } from '@resvg/resvg-js'; -import { CreateImage } from '../types'; +import type { CreateImage } from '../types'; export const createImage = ({ svg, zoom = 5 }: CreateImage) => { const resvg = new Resvg(svg, { diff --git a/src/utils/isValidCategory.ts b/src/utils/isValidCategory.ts index 32514a9..ed43361 100644 --- a/src/utils/isValidCategory.ts +++ b/src/utils/isValidCategory.ts @@ -1,5 +1,5 @@ import { CATEGORIES } from '../config/categories'; -import { Category } from '../types'; +import type { Category } from '../types'; export const isValidCategory = (category: unknown): category is Category => { return typeof category === 'string' && Object.keys(CATEGORIES).includes(category); diff --git a/src/yargs.ts b/src/yargs.ts index 2b9b396..7488888 100644 --- a/src/yargs.ts +++ b/src/yargs.ts @@ -1,7 +1,7 @@ import yargs from 'yargs/yargs'; import { CATEGORIES } from './config/categories'; import { OUTPUT_FORMATS } from './config/output'; -import { Category, OutputFormat } from './types'; +import type { Category, OutputFormat } from './types'; import { isPairingCode } from './utils/number'; export const argv = yargs(process.argv.slice(2))