diff --git a/packages/nuxt3/src/config/config/build.ts b/packages/nuxt3/src/config/config/build.ts index c04bbb3f2a..6a44cf0cbc 100644 --- a/packages/nuxt3/src/config/config/build.ts +++ b/packages/nuxt3/src/config/config/build.ts @@ -72,14 +72,6 @@ interface UrlLoaderOptions { mimetype?: string } -interface WebpackEnv { - isClient: boolean - isDev: boolean - isLegacy: boolean - isModern: boolean - isServer: boolean -} - interface PostcssOrderPresetFunctions { cssnanoLast: (names: string[]) => string[] presetEnvAndCssnanoLast: (names: string[]) => string[] @@ -97,7 +89,7 @@ interface PostcssConfiguration { order?: PostcssOrderPreset | string[] | ((names: string[], presets: PostcssOrderPresetFunctions) => string[]) plugins?: { [key: string]: false | { [key: string]: any } - } | ((loader: any) => PostcssPlugin[]) | Array<[string | PostcssPlugin, any] | string | PostcssPlugin> + } | ((loader: any) => PostcssPlugin[]) | Array<[string | PostcssPlugin, any] | string | PostcssPlugin> preset?: { autoprefixer?: false | AutoprefixerOptions browsers?: string @@ -106,19 +98,13 @@ interface PostcssConfiguration { [key: string]: boolean | { [key: string]: any } } importFrom?: string | string[] | Partial | (() => Partial) - insertAfter?: { [key: string]: PostcssPlugin } - insertBefore?: { [key: string]: PostcssPlugin } + insertAfter?: { [key: string]: PostcssPlugin } + insertBefore?: { [key: string]: PostcssPlugin } preserve?: boolean stage?: 0 | 1 | 2 | 3 | 4 | false } } -interface VueStyleOptions { - manualInject?: boolean - ssrId?: boolean - shadowMode?: boolean -} - interface Loaders { css?: CssLoaderOptions cssModules?: CssLoaderOptions diff --git a/packages/nuxt3/src/core/resolver.ts b/packages/nuxt3/src/core/resolver.ts index 8e75759cdd..afede72207 100644 --- a/packages/nuxt3/src/core/resolver.ts +++ b/packages/nuxt3/src/core/resolver.ts @@ -23,7 +23,7 @@ interface RequireModuleOptions { export default class Resolver { _require: NodeJS.Require - _resolve: RequireResolve + _resolve: NodeJS.RequireResolve nuxt: Nuxt options: Nuxt['options'] diff --git a/packages/nuxt3/src/server/jsdom.ts b/packages/nuxt3/src/server/jsdom.ts index ecec7f6436..23c4934a82 100644 --- a/packages/nuxt3/src/server/jsdom.ts +++ b/packages/nuxt3/src/server/jsdom.ts @@ -46,7 +46,7 @@ export default async function renderAndGetWindow ( if (options.virtualConsole) { if (options.virtualConsole === undefined) { - options.virtualConsole = new jsdom.VirtualConsole().sendTo(consola as unknown as Console) + options.virtualConsole = new jsdom.VirtualConsole().sendTo(consola as unknown as typeof console) } // Throw error when window creation failed options.virtualConsole.on('jsdomError', jsdomErrHandler) diff --git a/packages/nuxt3/src/utils/modern.ts b/packages/nuxt3/src/utils/modern.ts index 86eb05f518..96d7653aa0 100644 --- a/packages/nuxt3/src/utils/modern.ts +++ b/packages/nuxt3/src/utils/modern.ts @@ -17,10 +17,10 @@ export const ModernBrowsers = { 'Mobile Safari': '10.3' } as const -type ModernBrowsers = { -readonly [key in keyof typeof ModernBrowsers]: SemVer } +type ModernBrowsersT = { -readonly [key in keyof typeof ModernBrowsers]: SemVer } let semver: typeof import('semver') -let __modernBrowsers: ModernBrowsers +let __modernBrowsers: ModernBrowsersT const getModernBrowsers = () => { if (__modernBrowsers) { @@ -35,7 +35,7 @@ const getModernBrowsers = () => { if (version) { allBrowsers[browser] = version } return allBrowsers }, - {} as ModernBrowsers + {} as ModernBrowsersT ) return __modernBrowsers } diff --git a/packages/nuxt3/src/utils/serialize.ts b/packages/nuxt3/src/utils/serialize.ts index d2ea21ebca..343b666518 100644 --- a/packages/nuxt3/src/utils/serialize.ts +++ b/packages/nuxt3/src/utils/serialize.ts @@ -1,9 +1,14 @@ import serialize from 'serialize-javascript' -export function normalizeFunctions (obj: Array): Array -export function normalizeFunctions (obj: null): null -export function normalizeFunctions (obj: Function): Function -export function normalizeFunctions (obj: Record): Record +// eslint-disable-next-line no-redeclare +export function normalizeFunctions(obj: Array): Array +// eslint-disable-next-line no-redeclare +export function normalizeFunctions(obj: null): null +// eslint-disable-next-line no-redeclare +export function normalizeFunctions(obj: Function): Function +// eslint-disable-next-line no-redeclare +export function normalizeFunctions(obj: Record): Record +// eslint-disable-next-line no-redeclare export function normalizeFunctions (obj: Array | null | Function | Record) { if (typeof obj !== 'object' || Array.isArray(obj) || obj === null) { return obj