From fae2179ee9a1557c4405664355475b2d93f77ec4 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 3 Feb 2022 18:02:55 +0000 Subject: [PATCH] chore: replace constructors with types (#3056) --- packages/kit/src/auto-import.ts | 4 ++-- packages/kit/src/plugin.ts | 2 +- packages/nitro/src/rollup/plugins/assets.ts | 8 ++++---- packages/schema/src/types/compatibility.ts | 2 +- packages/schema/src/types/components.ts | 2 +- packages/schema/src/types/imports.ts | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/kit/src/auto-import.ts b/packages/kit/src/auto-import.ts index fc833a03ea..cf422f97db 100644 --- a/packages/kit/src/auto-import.ts +++ b/packages/kit/src/auto-import.ts @@ -12,10 +12,10 @@ export function addAutoImport (_autoImports: AutoImport | AutoImport[]) { }) } -export function addAutoImportDir (_autoImportDirs: String | String[]) { +export function addAutoImportDir (_autoImportDirs: string | string[]) { assertNuxtCompatibility({ bridge: true }) - useNuxt().hook('autoImports:dirs', (autoImportDirs: String[]) => { + useNuxt().hook('autoImports:dirs', (autoImportDirs: string[]) => { for (const dir of (Array.isArray(_autoImportDirs) ? _autoImportDirs : [_autoImportDirs])) { autoImportDirs.push(dir) } diff --git a/packages/kit/src/plugin.ts b/packages/kit/src/plugin.ts index 75c78a03b7..01bce37f39 100644 --- a/packages/kit/src/plugin.ts +++ b/packages/kit/src/plugin.ts @@ -49,7 +49,7 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin { * }) * ``` */ -export interface AddPluginOptions { append?: Boolean } +export interface AddPluginOptions { append?: boolean } export function addPlugin (_plugin: NuxtPlugin | string, opts: AddPluginOptions = {}) { const nuxt = useNuxt() diff --git a/packages/nitro/src/rollup/plugins/assets.ts b/packages/nitro/src/rollup/plugins/assets.ts index 21ca09178f..b9c86717a4 100644 --- a/packages/nitro/src/rollup/plugins/assets.ts +++ b/packages/nitro/src/rollup/plugins/assets.ts @@ -7,7 +7,7 @@ import { globby } from 'globby' import virtual from './virtual' export interface AssetOptions { - inline: Boolean + inline: boolean dirs: { [assetdir: string]: { dir: string @@ -17,10 +17,10 @@ export interface AssetOptions { } interface Asset { - fsPath: string, + fsPath: string meta: { - type?: string, - etag?: string, + type?: string + etag?: string mtime?: string } } diff --git a/packages/schema/src/types/compatibility.ts b/packages/schema/src/types/compatibility.ts index adb23019c9..e6c0b59259 100644 --- a/packages/schema/src/types/compatibility.ts +++ b/packages/schema/src/types/compatibility.ts @@ -13,7 +13,7 @@ export interface NuxtCompatibility { * - `true`: When using Nuxt 2, using bridge module is required * - `false`: When using Nuxt 2, using bridge module is not supported */ - bridge?: Boolean + bridge?: boolean } export interface NuxtCompatibilityIssue { diff --git a/packages/schema/src/types/components.ts b/packages/schema/src/types/components.ts index 378c827384..7b53af63ce 100644 --- a/packages/schema/src/types/components.ts +++ b/packages/schema/src/types/components.ts @@ -90,5 +90,5 @@ export interface ComponentsDir extends ScanDir { export interface ComponentsOptions { dirs: (string | ComponentsDir)[] - loader?: Boolean + loader?: boolean } diff --git a/packages/schema/src/types/imports.ts b/packages/schema/src/types/imports.ts index ba098ca7b4..30f60dc3ea 100644 --- a/packages/schema/src/types/imports.ts +++ b/packages/schema/src/types/imports.ts @@ -18,7 +18,7 @@ export interface AutoImport { /** * Disable auto import */ - disabled?: Boolean + disabled?: boolean } export interface AutoImportSource { @@ -34,7 +34,7 @@ export interface AutoImportSource { /** * Disable auto import source */ - disabled?: Boolean + disabled?: boolean } export interface AutoImportsOptions {