diff --git a/package.json b/package.json index a5b804c55e..72d8e99fdf 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "devalue": "4.3.2", "eslint": "8.51.0", "eslint-plugin-import": "2.28.1", - "eslint-plugin-jsdoc": "41.1.2", + "eslint-plugin-jsdoc": "46.8.2", "eslint-plugin-no-only-tests": "3.1.0", "execa": "7.2.0", "fs-extra": "11.1.1", diff --git a/packages/kit/src/build.ts b/packages/kit/src/build.ts index 507af75ff4..14fce6347d 100644 --- a/packages/kit/src/build.ts +++ b/packages/kit/src/build.ts @@ -5,25 +5,21 @@ import { useNuxt } from './context' export interface ExtendConfigOptions { /** * Install plugin on dev - * * @default true */ dev?: boolean /** * Install plugin on build - * * @default true */ build?: boolean /** * Install plugin on server side - * * @default true */ server?: boolean /** * Install plugin on client side - * * @default true */ client?: boolean diff --git a/packages/kit/src/context.ts b/packages/kit/src/context.ts index cac5fbae6e..d132b81c6c 100644 --- a/packages/kit/src/context.ts +++ b/packages/kit/src/context.ts @@ -10,7 +10,6 @@ export const nuxtCtx = getContext('nuxt') * Get access to Nuxt instance. * * Throws an error if Nuxt instance is unavailable. - * * @example * ```js * const nuxt = useNuxt() @@ -28,7 +27,6 @@ export function useNuxt (): Nuxt { * Get access to Nuxt instance. * * Returns null if Nuxt instance is unavailable. - * * @example * ```js * const nuxt = tryUseNuxt() diff --git a/packages/kit/src/ignore.ts b/packages/kit/src/ignore.ts index 76e181df62..8c42d3a051 100644 --- a/packages/kit/src/ignore.ts +++ b/packages/kit/src/ignore.ts @@ -57,7 +57,6 @@ export function resolveIgnorePatterns (relativePath?: string): string[] { * This function turns string containing groups '**\/*.{spec,test}.{js,ts}' into an array of strings. * For example will '**\/*.{spec,test}.{js,ts}' be resolved to: * ['**\/*.spec.js', '**\/*.spec.ts', '**\/*.test.js', '**\/*.test.ts'] - * * @param group string containing the group syntax * @returns {string[]} array of strings without the group syntax */ diff --git a/packages/kit/src/nitro.ts b/packages/kit/src/nitro.ts index 66374a9d04..be642efc4b 100644 --- a/packages/kit/src/nitro.ts +++ b/packages/kit/src/nitro.ts @@ -67,7 +67,6 @@ export function addPrerenderRoutes (routes: string | string[]) { * **Note:** You can call `useNitro()` only after `ready` hook. * * **Note:** Changes to the Nitro instance configuration are not applied. - * * @example * * ```ts diff --git a/packages/kit/src/pages.ts b/packages/kit/src/pages.ts index e303c17cf2..688b78786e 100644 --- a/packages/kit/src/pages.ts +++ b/packages/kit/src/pages.ts @@ -18,7 +18,6 @@ export function extendPages (cb: NuxtHooks['pages:extend']) { export interface ExtendRouteRulesOptions { /** * Override route rule config - * * @default false */ override?: boolean @@ -39,7 +38,6 @@ export function extendRouteRules (route: string, rule: NitroRouteConfig, options export interface AddRouteMiddlewareOptions { /** * Override existing middleware with the same name, if it exists - * * @default false */ override?: boolean diff --git a/packages/kit/src/plugin.ts b/packages/kit/src/plugin.ts index 390219e67c..21b6b33ee1 100644 --- a/packages/kit/src/plugin.ts +++ b/packages/kit/src/plugin.ts @@ -48,7 +48,6 @@ export function normalizePlugin (plugin: NuxtPlugin | string): NuxtPlugin { * to use plugin only in client or server side. * * Note: By default plugin is prepended to the plugins array. You can use second argument to append (push) instead. - * * @example * ```js * addPlugin({ diff --git a/packages/nuxt/src/app/components/utils.ts b/packages/nuxt/src/app/components/utils.ts index cc7c5e741c..c98d8efaac 100644 --- a/packages/nuxt/src/app/components/utils.ts +++ b/packages/nuxt/src/app/components/utils.ts @@ -6,7 +6,6 @@ import destr from 'destr' /** * Internal utility - * * @private */ export const _wrapIf = (component: Component, props: any, slots: any) => { @@ -20,7 +19,6 @@ export type SSRBufferItem = string | SSRBuffer | Promise /** * create buffer retrieved from @vue/server-renderer - * * @see https://github.com/vuejs/core/blob/9617dd4b2abc07a5dc40de6e5b759e851b4d0da1/packages/server-renderer/src/render.ts#L57 * @private */ @@ -102,7 +100,6 @@ export function vforToArray (source: any): any[] { /** * Retrieve the HTML content from an element * Handles `` Fragment elements - * * @param element the element to retrieve the HTML * @param withoutSlots purge all slots from the HTML string retrieved * @returns {string[]} An array of string which represent the content of each element. Use `.join('')` to retrieve a component vnode.el HTML diff --git a/packages/nuxt/src/app/composables/chunk.ts b/packages/nuxt/src/app/composables/chunk.ts index 71bfe3bdd7..c20cff0f9b 100644 --- a/packages/nuxt/src/app/composables/chunk.ts +++ b/packages/nuxt/src/app/composables/chunk.ts @@ -4,26 +4,22 @@ import { useNuxtApp } from '#app/nuxt' export interface ReloadNuxtAppOptions { /** * Number of milliseconds in which to ignore future reload requests - * * @default {10000} */ ttl?: number /** * Force a reload even if one has occurred within the previously specified TTL. - * * @default {false} */ force?: boolean /** * Whether to dump the current Nuxt state to sessionStorage (as `nuxt:reload:state`). - * * @default {false} */ persistState?: boolean /** * The path to reload. If this is different from the current window location it will * trigger a navigation and add an entry in the browser history. - * * @default {window.location.pathname} */ path?: string diff --git a/packages/nuxt/src/app/composables/hydrate.ts b/packages/nuxt/src/app/composables/hydrate.ts index 3aa4053402..1de7e356af 100644 --- a/packages/nuxt/src/app/composables/hydrate.ts +++ b/packages/nuxt/src/app/composables/hydrate.ts @@ -3,7 +3,6 @@ import type { NuxtPayload } from '#app' /** * Allows full control of the hydration cycle to set and receive data from the server. - * * @param key a unique key to identify the data in the Nuxt payload * @param get a function that returns the value to set the initial data * @param set a function that will receive the data on the client-side diff --git a/packages/nuxt/src/app/composables/preload.ts b/packages/nuxt/src/app/composables/preload.ts index b012accc51..e8e4216ec3 100644 --- a/packages/nuxt/src/app/composables/preload.ts +++ b/packages/nuxt/src/app/composables/preload.ts @@ -5,7 +5,6 @@ import { useRouter } from './router' /** * Preload a component or components that have been globally registered. - * * @param components Pascal-cased name or names of components to prefetch */ export const preloadComponents = async (components: string | string[]) => { @@ -18,7 +17,6 @@ export const preloadComponents = async (components: string | string[]) => { /** * Prefetch a component or components that have been globally registered. - * * @param components Pascal-cased name or names of components to prefetch */ export const prefetchComponents = (components: string | string[]) => { diff --git a/packages/nuxt/src/app/composables/state.ts b/packages/nuxt/src/app/composables/state.ts index 4b5c1ec97f..3746b1f36b 100644 --- a/packages/nuxt/src/app/composables/state.ts +++ b/packages/nuxt/src/app/composables/state.ts @@ -5,7 +5,6 @@ import { useNuxtApp } from '../nuxt' const useStateKeyPrefix = '$s' /** * Create a global reactive ref that will be hydrated but not shared across ssr requests - * * @param key a unique key ensuring that data fetching can be properly de-duplicated across requests * @param init a function that provides initial value for the state when it's not initiated */ diff --git a/packages/nuxt/src/app/nuxt.ts b/packages/nuxt/src/app/nuxt.ts index 1a933c2a21..2f2554d609 100644 --- a/packages/nuxt/src/app/nuxt.ts +++ b/packages/nuxt/src/app/nuxt.ts @@ -163,7 +163,6 @@ export interface PluginEnvContext { /** * This enable the plugin for islands components. * Require `experimental.componentsIslands`. - * * @default true */ islands?: boolean @@ -186,7 +185,6 @@ export interface ObjectPlugin = Recor env?: PluginEnvContext /** * Execute plugin in parallel with other parallel plugins. - * * @default false */ parallel?: boolean @@ -361,7 +359,6 @@ export function isNuxtPlugin (plugin: unknown) { /** * Ensures that the setup function passed in has access to the Nuxt instance via `useNuxt`. - * * @param nuxt A Nuxt instance * @param setup The function to call */ diff --git a/packages/nuxt/src/components/scan.ts b/packages/nuxt/src/components/scan.ts index dba57cfd93..a5093b9305 100644 --- a/packages/nuxt/src/components/scan.ts +++ b/packages/nuxt/src/components/scan.ts @@ -11,7 +11,6 @@ import type { Component, ComponentsDir } from 'nuxt/schema' /** * Scan the components inside different components folders * and return a unique list of components - * * @param dirs all folders where components are defined * @param srcDir src path of your app * @returns {Promise} Component found promise @@ -65,7 +64,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr /** * Create an array of prefixes base on the prefix config * Empty prefix will be an empty array - * * @example prefix: 'nuxt' -> ['nuxt'] * @example prefix: 'nuxt-test' -> ['nuxt', 'test'] */ @@ -76,7 +74,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr /** * In case we have index as filename the component become the parent path - * * @example third-components/index.vue -> third-component * if not take the filename * @example third-components/Awesome.vue -> Awesome @@ -163,7 +160,6 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr export function resolveComponentName (fileName: string, prefixParts: string[]) { /** * Array of fileName parts splitted by case, / or - - * * @example third-component -> ['third', 'component'] * @example AwesomeComponent -> ['Awesome', 'Component'] */ diff --git a/packages/nuxt/src/components/tree-shake.ts b/packages/nuxt/src/components/tree-shake.ts index 9136267f4e..1bcdb4dfb2 100644 --- a/packages/nuxt/src/components/tree-shake.ts +++ b/packages/nuxt/src/components/tree-shake.ts @@ -220,7 +220,6 @@ function isComponentNotCalledInSetup (codeAst: Node, name: string): string | voi /** * retrieve the component identifier being used on ssrRender callExpression - * * @param {CallExpression} ssrRenderNode - ssrRender callExpression */ function getComponentName (ssrRenderNode: AcornNode): string { diff --git a/packages/nuxt/src/core/external-config-files.ts b/packages/nuxt/src/core/external-config-files.ts index 4bc9da5b53..84b7231954 100644 --- a/packages/nuxt/src/core/external-config-files.ts +++ b/packages/nuxt/src/core/external-config-files.ts @@ -5,7 +5,6 @@ import { generateApp as _generateApp } from './app' /** * Check for those external configuration files that are not compatible with Nuxt, * and warns the user about them. - * * @see {@link https://nuxt.com/docs/getting-started/configuration#external-configuration-files} */ export async function checkForExternalConfigurationFiles () { diff --git a/packages/schema/src/config/adhoc.ts b/packages/schema/src/config/adhoc.ts index 817363cbff..1a34d0f47c 100644 --- a/packages/schema/src/config/adhoc.ts +++ b/packages/schema/src/config/adhoc.ts @@ -6,7 +6,6 @@ export default defineUntypedSchema({ * * Any components in the directories configured here can be used throughout your * pages, layouts (and other components) without needing to explicitly import them. - * * @see https://nuxt.com/docs/guide/directory-structure/components * @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']} */ @@ -24,7 +23,6 @@ export default defineUntypedSchema({ /** * Configure how Nuxt auto-imports composables into your application. - * * @see [Nuxt 3 documentation](https://nuxt.com/docs/guide/directory-structure/composables) * @type {typeof import('../src/types/imports').ImportsOptions} */ @@ -34,7 +32,6 @@ export default defineUntypedSchema({ /** * An array of custom directories that will be auto-imported. * Note that this option will not override the default directories (~/composables, ~/utils). - * * @example * ```js * imports: { @@ -49,14 +46,12 @@ export default defineUntypedSchema({ /** * Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be * enabled if you have a `pages/` directory in your source folder. - * * @type {boolean} */ pages: undefined, /** * Manually disable nuxt telemetry. - * * @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information. * @type {boolean | Record} */ @@ -67,7 +62,6 @@ export default defineUntypedSchema({ * * This is an experimental feature. * Breaking changes for devtools might not reflect on the version of Nuxt. - * * @see [Nuxt DevTools](https://devtools.nuxtjs.org/) for more information. * @experimental * @type {boolean | { enabled: boolean, [key: string]: any }} diff --git a/packages/schema/src/config/app.ts b/packages/schema/src/config/app.ts index 01ad2c02c5..945832acdf 100644 --- a/packages/schema/src/config/app.ts +++ b/packages/schema/src/config/app.ts @@ -10,7 +10,6 @@ export default defineUntypedSchema({ vue: { /** * Options for the Vue compiler that will be passed at build time. - * * @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {typeof import('@vue/compiler-core').CompilerOptions} */ @@ -25,7 +24,6 @@ export default defineUntypedSchema({ /** * Vue Experimental: Enable reactive destructure for `defineProps` - * * @see [Vue RFC#502](https://github.com/vuejs/rfcs/discussions/502) * @type {boolean} */ @@ -33,7 +31,6 @@ export default defineUntypedSchema({ /** * Vue Experimental: Enable macro `defineModel` - * * @see [Vue RFC#503](https://github.com/vuejs/rfcs/discussions/503) * @type {boolean} */ @@ -48,7 +45,6 @@ export default defineUntypedSchema({ * The base path of your Nuxt application. * * This can be set at runtime by setting the NUXT_APP_BASE_URL environment variable. - * * @example * ```bash * NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs @@ -67,7 +63,6 @@ export default defineUntypedSchema({ * An absolute URL to serve the public folder from (production-only). * * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. - * * @example * ```bash * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs @@ -79,7 +74,6 @@ export default defineUntypedSchema({ /** * Set default configuration for `` on every page. - * * @example * ```js * app: { @@ -143,7 +137,6 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * * @see https://vuejs.org/api/built-in-components.html#transition * @type {typeof import('../src/types/config').NuxtAppConfig['layoutTransition']} */ @@ -154,7 +147,6 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * * @see https://vuejs.org/api/built-in-components.html#transition * @type {typeof import('../src/types/config').NuxtAppConfig['pageTransition']} */ @@ -165,7 +157,6 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * * @see https://vuejs.org/api/built-in-components.html#keepalive * @type {typeof import('../src/types/config').NuxtAppConfig['keepalive']} */ @@ -173,7 +164,6 @@ export default defineUntypedSchema({ /** * Customize Nuxt root element id. - * * @type {string | false} */ rootId: { @@ -196,7 +186,6 @@ export default defineUntypedSchema({ * - If true, Nuxt will look for `~/app/spa-loading-template.html` file or a default Nuxt image will be used. * * Some good sources for spinners are [SpinKit](https://github.com/tobiasahlin/SpinKit) or [SVG Spinners](https://icones.js.org/collection/svg-spinners). - * * @example ~/app/spa-loading-template.html * ```html * @@ -254,7 +243,6 @@ export default defineUntypedSchema({ * in the appropriate context. * * It can also be an object with `src` and `mode` keys. - * * @note Plugins are also auto-registered from the `~/plugins` directory * and these plugins do not need to be listed in `nuxt.config` unless you * need to customize their order. All plugins are deduplicated by their src path. @@ -281,7 +269,6 @@ export default defineUntypedSchema({ * Nuxt will automatically guess the file type by its extension and use the * appropriate pre-processor. You will still need to install the required * loader if you need to use them. - * * @example * ```js * css: [ diff --git a/packages/schema/src/config/build.ts b/packages/schema/src/config/build.ts index 30a3227068..18ba222654 100644 --- a/packages/schema/src/config/build.ts +++ b/packages/schema/src/config/build.ts @@ -7,7 +7,6 @@ import { consola } from 'consola' export default defineUntypedSchema({ /** * The builder to use for bundling the Vue part of your application. - * * @type {'vite' | 'webpack' | { bundle: (nuxt: typeof import('../src/types/nuxt').Nuxt) => Promise }} */ builder: { @@ -25,7 +24,6 @@ export default defineUntypedSchema({ /** * Whether to generate sourcemaps. - * * @type {boolean | { server?: boolean | 'hidden', client?: boolean | 'hidden' }} */ sourcemap: { @@ -45,7 +43,6 @@ export default defineUntypedSchema({ * * Defaults to 'silent' when running in CI or when a TTY is not available. * This option is then used as 'silent' in Vite and 'none' in Webpack - * * @type {'silent' | 'info' | 'verbose'} */ logLevel: { @@ -67,7 +64,6 @@ export default defineUntypedSchema({ * dependency's file name. * * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). - * * @example * ```js transpile: [({ isLegacy }) => isLegacy && 'ky'] @@ -83,7 +79,6 @@ export default defineUntypedSchema({ * on Nuxt configuration. This feature is specially useful for using with modules. * * Templates are rendered using [`lodash/template`](https://lodash.com/docs/4.17.15#template). - * * @example * ```js * templates: [ @@ -105,7 +100,6 @@ export default defineUntypedSchema({ * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. * * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). - * * @example * ```js * analyze: { @@ -142,7 +136,6 @@ export default defineUntypedSchema({ * and client. You will need to take steps to handle this additional key. * * The key will be unique based on the location of the function being invoked within the file. - * * @type {Array<{ name: string, source?: string | RegExp, argumentLength: number }>} */ keyedComposables: { @@ -162,7 +155,6 @@ export default defineUntypedSchema({ treeShake: { /** * Tree shake composables from the server or client builds. - * * @example * ```js * treeShake: { client: { myPackage: ['useServerOnlyComposable'] } } @@ -195,7 +187,6 @@ export default defineUntypedSchema({ /** * Options passed directly to the transformer from `unctx` that preserves async context * after `await`. - * * @type {typeof import('unctx/transform').TransformerOptions} */ asyncTransforms: { diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index b251c503af..7d87c0c3b9 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -12,7 +12,6 @@ export default defineUntypedSchema({ * Value should be either a string or array of strings pointing to source directories or config path relative to current config. * * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. - * * @type {string|string[]} */ extends: null, @@ -23,7 +22,6 @@ export default defineUntypedSchema({ * Value should be a string pointing to source directory or config path relative to current config. * * You can use `github:`, `gitlab:`, `bitbucket:` or `https://` to extend from a remote git repository. - * * @type {string} */ theme: null, @@ -57,7 +55,6 @@ export default defineUntypedSchema({ * Define the source directory of your Nuxt application. * * If a relative path is specified, it will be relative to the `rootDir`. - * * @example * ```js * export default { @@ -105,7 +102,6 @@ export default defineUntypedSchema({ * * Many tools assume that `.nuxt` is a hidden directory (because it starts * with a `.`). If that is a problem, you can use this option to prevent that. - * * @example * ```js * export default { @@ -124,7 +120,6 @@ export default defineUntypedSchema({ * The configuration path is relative to `options.rootDir` (default is current working directory). * * Setting this field may be necessary if your project is organized as a yarn workspace-styled mono-repository. - * * @example * ```js * export default { @@ -190,7 +185,6 @@ export default defineUntypedSchema({ * * Nuxt tries to resolve each item in the modules array using node require path * (in `node_modules`) and then will be resolved from project `srcDir` if `~` alias is used. - * * @note Modules are executed sequentially so the order is important. * @example * ```js @@ -271,7 +265,6 @@ export default defineUntypedSchema({ /** * You can improve your DX by defining additional aliases to access custom directories * within your JavaScript and CSS. - * * @note Within a webpack context (image sources, CSS - but not JavaScript) you _must_ access * your alias by prefixing it with `~`. * @note These aliases will be automatically added to the generated `.nuxt/tsconfig.json` so you can get full @@ -323,7 +316,6 @@ export default defineUntypedSchema({ /** * Pass options directly to `node-ignore` (which is used by Nuxt to ignore files). - * * @see [node-ignore](https://github.com/kaelzhang/node-ignore) * @example * ```js @@ -364,7 +356,6 @@ export default defineUntypedSchema({ * It is an array of strings or regular expressions. Strings should be either absolute paths or * relative to the `srcDir` (and the `srcDir` of any layers). Regular expressions will be matched * against the path relative to the project `srcDir` (and the `srcDir` of any layers). - * * @type {Array} */ watch: { @@ -379,7 +370,6 @@ export default defineUntypedSchema({ rewatchOnRawEvents: undefined, /** * `watchOptions` to pass directly to webpack. - * * @see [webpack@4 watch options](https://v4.webpack.js.org/configuration/watch/#watchoptions). */ webpack: { @@ -387,7 +377,6 @@ export default defineUntypedSchema({ }, /** * Options to pass directly to `chokidar`. - * * @see [chokidar](https://github.com/paulmillr/chokidar#api) */ chokidar: { @@ -403,7 +392,6 @@ export default defineUntypedSchema({ * * For ease of configuration, you can also structure them as an hierarchical * object in `nuxt.config` (as below). - * * @example * ```js'node:fs' * import fs from 'node:fs' @@ -438,7 +426,6 @@ export default defineUntypedSchema({ * * Values are automatically replaced by matching env variables at runtime, e.g. setting an environment * variable `NUXT_API_KEY=my-api-key NUXT_PUBLIC_BASE_URL=/foo/` would overwrite the two values in the example below. - * * @example * ```js * export default { @@ -471,7 +458,6 @@ export default defineUntypedSchema({ * * For programmatic usage and type support, you can directly provide app config with this option. * It will be merged with `app.config` file as default value. - * * @type {typeof import('../src/types/config').AppConfig} */ appConfig: { diff --git a/packages/schema/src/config/dev.ts b/packages/schema/src/config/dev.ts index dd6de8cdfe..209513ba69 100644 --- a/packages/schema/src/config/dev.ts +++ b/packages/schema/src/config/dev.ts @@ -5,7 +5,6 @@ export default defineUntypedSchema({ devServer: { /** * Whether to enable HTTPS. - * * @example * ``` * export default defineNuxtConfig({ @@ -37,7 +36,6 @@ export default defineUntypedSchema({ /** * Template to show a loading screen - * * @type {(data: { loading?: string }) => string} */ loadingTemplate diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index 6e73ac3f28..fb65f1c513 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -11,7 +11,6 @@ export default defineUntypedSchema({ /** * Enable Vue's reactivity transform - * * @see https://vuejs.org/guide/extras/reactivity-transform.html * * Warning: Reactivity transform feature has been marked as deprecated in Vue 3.3 and is planned to be @@ -24,14 +23,12 @@ export default defineUntypedSchema({ // https://github.com/unjs/nitro/issues/1118 /** * Externalize `vue`, `@vue/*` and `vue-router` when building. - * * @see https://github.com/nuxt/nuxt/issues/13632 */ externalVue: true, /** * Tree shakes contents of client-only components from server bundle. - * * @see https://github.com/nuxt/framework/pull/5750 */ treeshakeClientOnly: true, @@ -45,7 +42,6 @@ export default defineUntypedSchema({ * * You can disable automatic handling by setting this to `false`, or handle * chunk errors manually by setting it to `manual`. - * * @see https://github.com/nuxt/nuxt/pull/19038 * @type {false | 'manual' | 'automatic'} */ @@ -82,7 +78,6 @@ export default defineUntypedSchema({ * Consider carefully before enabling this as it can cause unexpected behavior, and * consider providing explicit keys to `useState` as auto-generated keys may not match * across builds. - * * @type {boolean} */ restoreState: false, @@ -92,7 +87,6 @@ export default defineUntypedSchema({ * * You can also pass a function that receives the path of a Vue component * and returns a boolean indicating whether to inline the styles for that component. - * * @type {boolean | ((id?: string) => boolean)} */ inlineSSRStyles: { @@ -121,7 +115,6 @@ export default defineUntypedSchema({ /** * When this option is enabled (by default) payload of pages that are prerendered are extracted - * * @type {boolean | undefined} */ payloadExtraction: true, @@ -137,21 +130,18 @@ export default defineUntypedSchema({ /** * Enable View Transition API integration with client-side router. - * * @see https://developer.chrome.com/docs/web-platform/view-transitions */ viewTransition: false, /** * Write early hints when using node server. - * * @note nginx does not support 103 Early hints in the current version. */ writeEarlyHints: false, /** * Experimental component islands support with and .island.vue files. - * * @type {true | 'local' | 'local+remote' | false} */ componentIslands: { @@ -164,7 +154,6 @@ export default defineUntypedSchema({ /** * Config schema support - * * @see https://github.com/nuxt/nuxt/issues/15592 */ configSchema: true, @@ -227,7 +216,6 @@ export default defineUntypedSchema({ * performance in large projects or on Windows platforms. * * You can also set this to `chokidar` to watch all files in your source directory. - * * @see https://github.com/paulmillr/chokidar * @see https://github.com/parcel-bundler/watcher * @type {'chokidar' | 'parcel' | 'chokidar-granular'} @@ -236,7 +224,6 @@ export default defineUntypedSchema({ /** * Enable native async context to be accessible for nested composables - * * @see https://github.com/nuxt/nuxt/pull/20918 */ asyncContext: false, @@ -245,7 +232,6 @@ export default defineUntypedSchema({ * Use new experimental head optimisations: * - Add the capo.js head plugin in order to render tags in of the head in a more performant way. * - Uses the hash hydration plugin to reduce initial hydration - * * @see https://github.com/nuxt/nuxt/discussions/22632 */ headNext: false, diff --git a/packages/schema/src/config/generate.ts b/packages/schema/src/config/generate.ts index 9882e6bb9b..8e5561ce38 100644 --- a/packages/schema/src/config/generate.ts +++ b/packages/schema/src/config/generate.ts @@ -9,7 +9,6 @@ export default defineUntypedSchema({ * This is often necessary when using dynamic routes. * * It is preferred to use `nitro.prerender.routes`. - * * @example * ```js * routes: ['/users/1', '/users/2', '/users/3'] @@ -20,7 +19,6 @@ export default defineUntypedSchema({ /** * This option is no longer used. Instead, use `nitro.prerender.ignore`. - * * @deprecated */ exclude: [] diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 359ce18461..3963b33274 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -3,7 +3,6 @@ import { defineUntypedSchema } from 'untyped' export default defineUntypedSchema({ /** * Configuration for Nitro. - * * @see https://nitro.unjs.io/config/ * @type {typeof import('nitropack')['NitroConfig']} */ @@ -18,7 +17,6 @@ export default defineUntypedSchema({ /** * Global route options applied to matching server routes. - * * @experimental This is an experimental feature and API may change in the future. * @see https://nitro.unjs.io/config/#routerules * @type {typeof import('nitropack')['NitroConfig']['routeRules']} @@ -34,7 +32,6 @@ export default defineUntypedSchema({ * - method: The HTTP method of requests that should be handled. * - middleware: Specifies whether it is a middleware handler. * - lazy: Specifies whether to use lazy loading to import the handler. - * * @see https://nuxt.com/docs/guide/directory-structure/server * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. * @example @@ -49,7 +46,6 @@ export default defineUntypedSchema({ /** * Nitro development-only server handlers. - * * @see https://nitro.unjs.io/guide/routing * @type {typeof import('nitropack')['NitroDevEventHandler'][]} */ diff --git a/packages/schema/src/config/postcss.ts b/packages/schema/src/config/postcss.ts index 29effcd4dd..98542ae637 100644 --- a/packages/schema/src/config/postcss.ts +++ b/packages/schema/src/config/postcss.ts @@ -8,7 +8,6 @@ export default defineUntypedSchema({ * Options for configuring PostCSS plugins. * * https://postcss.org/ - * * @type {Record} */ plugins: { diff --git a/packages/schema/src/config/router.ts b/packages/schema/src/config/router.ts index 279a609c87..99d2e3ae03 100644 --- a/packages/schema/src/config/router.ts +++ b/packages/schema/src/config/router.ts @@ -8,7 +8,6 @@ export default defineUntypedSchema({ * Note: Only JSON serializable options should be passed by nuxt config. * * For more control, you can use `app/router.options.ts` file. - * * @see [documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). * @type {typeof import('../src/types/router').RouterConfigSerializable} */ diff --git a/packages/schema/src/config/typescript.ts b/packages/schema/src/config/typescript.ts index 29b7886eda..e2ae05df6f 100644 --- a/packages/schema/src/config/typescript.ts +++ b/packages/schema/src/config/typescript.ts @@ -20,7 +20,6 @@ export default defineUntypedSchema({ * builder environment types (with `false`) to handle this fully yourself, or opt for a 'shared' option. * * The 'shared' option is advised for module authors, who will want to support multiple possible builders. - * * @type {'vite' | 'webpack' | 'shared' | false | undefined} */ builder: { @@ -37,7 +36,6 @@ export default defineUntypedSchema({ * * If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. * Requires to install `typescript` and `vue-tsc` as dev dependencies. - * * @see https://nuxt.com/docs/guide/concepts/typescript * @type {boolean | 'build'} */ @@ -45,7 +43,6 @@ export default defineUntypedSchema({ /** * You can extend generated `.nuxt/tsconfig.json` using this option. - * * @type {typeof import('pkg-types')['TSConfig']} */ tsConfig: {}, diff --git a/packages/schema/src/config/vite.ts b/packages/schema/src/config/vite.ts index 747f513a1b..f62bd2880d 100644 --- a/packages/schema/src/config/vite.ts +++ b/packages/schema/src/config/vite.ts @@ -10,7 +10,6 @@ export default defineUntypedSchema({ * * See https://vitejs.dev/config for more information. * Please note that not all vite options are supported in Nuxt. - * * @type {typeof import('../src/types/config').ViteConfig & { $client?: typeof import('../src/types/config').ViteConfig, $server?: typeof import('../src/types/config').ViteConfig }} */ vite: { diff --git a/packages/schema/src/config/webpack.ts b/packages/schema/src/config/webpack.ts index f8938ddda6..d3ed67749c 100644 --- a/packages/schema/src/config/webpack.ts +++ b/packages/schema/src/config/webpack.ts @@ -7,7 +7,6 @@ export default defineUntypedSchema({ * Nuxt uses `webpack-bundle-analyzer` to visualize your bundles and how to optimize them. * * Set to `true` to enable bundle analysis, or pass an object with options: [for webpack](https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin) or [for vite](https://github.com/btd/rollup-plugin-visualizer#options). - * * @example * ```js * analyze: { @@ -35,7 +34,6 @@ export default defineUntypedSchema({ * Enable the profiler in webpackbar. * * It is normally enabled by CLI argument `--profile`. - * * @see [webpackbar](https://github.com/unjs/webpackbar#profile). */ profile: process.argv.includes('--profile'), @@ -46,7 +44,6 @@ export default defineUntypedSchema({ * Using [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) under the hood, your CSS will be extracted * into separate files, usually one per component. This allows caching your CSS and * JavaScript separately. - * * @example * ```js * export default { @@ -107,7 +104,6 @@ export default defineUntypedSchema({ * Customize bundle filenames. * * To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/). - * * @note Be careful when using non-hashed based filenames in production * as most browsers will cache the asset and not detect the changes on first load. * @@ -165,14 +161,12 @@ export default defineUntypedSchema({ /** * See https://github.com/esbuild-kit/esbuild-loader - * * @type {Omit} */ esbuild: {}, /** * See: https://github.com/webpack-contrib/file-loader#options - * * @type {Omit} * @default * ```ts @@ -183,7 +177,6 @@ export default defineUntypedSchema({ /** * See: https://github.com/webpack-contrib/file-loader#options - * * @type {Omit} * @default * ```ts @@ -194,7 +187,6 @@ export default defineUntypedSchema({ /** * See: https://github.com/webpack-contrib/file-loader#options - * * @type {Omit} * @default * ```ts @@ -205,14 +197,12 @@ export default defineUntypedSchema({ /** * See: https://pugjs.org/api/reference.html#options - * * @type {typeof import('pug')['Options']} */ pugPlain: {}, /** * See [vue-loader](https://github.com/vuejs/vue-loader) for available options. - * * @type {Partial} */ vue: { @@ -253,7 +243,6 @@ export default defineUntypedSchema({ /** * See: https://github.com/webpack-contrib/sass-loader#options - * * @type {typeof import('sass-loader')['Options']} * @default * ```ts @@ -272,7 +261,6 @@ export default defineUntypedSchema({ /** * See: https://github.com/webpack-contrib/sass-loader#options - * * @type {typeof import('sass-loader')['Options']} */ scss: {}, @@ -287,7 +275,6 @@ export default defineUntypedSchema({ /** * Add webpack plugins. - * * @example * ```js * import webpack from 'webpack' @@ -311,7 +298,6 @@ export default defineUntypedSchema({ * OptimizeCSSAssets plugin options. * * Defaults to true when `extractCSS` is enabled. - * * @see [css-minimizer-webpack-plugin documentation](https://github.com/webpack-contrib/css-minimizer-webpack-plugin). * @type {false | typeof import('css-minimizer-webpack-plugin').BasePluginOptions & typeof import('css-minimizer-webpack-plugin').DefinedDefaultMinimizerAndOptions} */ @@ -321,7 +307,6 @@ export default defineUntypedSchema({ /** * Configure [webpack optimization](https://webpack.js.org/configuration/optimization/). - * * @type {false | typeof import('webpack').Configuration['optimization']} */ optimization: { @@ -340,7 +325,6 @@ export default defineUntypedSchema({ /** * Customize PostCSS Loader. * Same options as https://github.com/webpack-contrib/postcss-loader#options - * * @type {{ execute?: boolean, postcssOptions: typeof import('postcss').ProcessOptions, sourceMap?: boolean, implementation?: any }} */ postcss: { @@ -356,7 +340,6 @@ export default defineUntypedSchema({ /** * See [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) for available options. - * * @type {typeof import('webpack-dev-middleware').Options} */ devMiddleware: { @@ -365,7 +348,6 @@ export default defineUntypedSchema({ /** * See [webpack-hot-middleware](https://github.com/webpack-contrib/webpack-hot-middleware) for available options. - * * @type {typeof import('webpack-hot-middleware').MiddlewareOptions & { client?: typeof import('webpack-hot-middleware').ClientOptions }} */ hotMiddleware: {}, @@ -377,14 +359,12 @@ export default defineUntypedSchema({ /** * Filters to hide build warnings. - * * @type {Array<(warn: typeof import('webpack').WebpackError) => boolean>} */ warningIgnoreFilters: [], /** * Configure [webpack experiments](https://webpack.js.org/configuration/experiments/) - * * @type {false | typeof import('webpack').Configuration['experiments']} */ experiments: {} diff --git a/packages/schema/src/types/builder-env/vite.ts b/packages/schema/src/types/builder-env/vite.ts index 58199475b9..06c444be52 100644 --- a/packages/schema/src/types/builder-env/vite.ts +++ b/packages/schema/src/types/builder-env/vite.ts @@ -38,7 +38,6 @@ export interface ImportGlobOptions< as?: AsType /** * Import as static or dynamic - * * @default false */ eager?: Eager @@ -52,7 +51,6 @@ export interface ImportGlobOptions< query?: string | Record /** * Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance. - * * @default false */ exhaustive?: boolean diff --git a/packages/schema/src/types/builder-env/webpack.ts b/packages/schema/src/types/builder-env/webpack.ts index 1fc3084bca..061d654a34 100644 --- a/packages/schema/src/types/builder-env/webpack.ts +++ b/packages/schema/src/types/builder-env/webpack.ts @@ -93,7 +93,6 @@ export interface AcceptOptions { export interface WebpackHot { /** * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. - * * @param dependencies * @param callback * @param errorHandler @@ -101,7 +100,6 @@ export interface WebpackHot { accept (dependencies: string[], callback?: (updatedDependencies: WebpackModuleId[]) => void, errorHandler?: (err: Error) => void): void /** * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. - * * @param dependency * @param callback * @param errorHandler @@ -111,7 +109,6 @@ export interface WebpackHot { * Accept code updates for this module without notification of parents. * This should only be used if the module doesn’t export anything. * The errHandler can be used to handle errors that occur while loading the updated module. - * * @param errHandler */ accept (errHandler?: (err: Error) => void): void @@ -132,7 +129,6 @@ export interface WebpackHot { * Here you should destroy/remove any persistent resource you have claimed/created. * If you want to transfer state to the new module, add it to data object. * The data will be available at module.hot.data on the new module. - * * @param callback */ dispose (callback: (data: any) => void): void @@ -142,7 +138,6 @@ export interface WebpackHot { * Here you should destroy/remove any persistent resource you have claimed/created. * If you want to transfer state to the new module, add it to data object. * The data will be available at module.hot.data on the new module. - * * @param callback */ addDisposeHandler (callback: (data: any) => void): void @@ -150,7 +145,6 @@ export interface WebpackHot { /** * Remove a handler. * This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function. - * * @param callback */ removeDisposeHandler (callback: (data: any) => void): void @@ -162,7 +156,6 @@ export interface WebpackHot { * If autoApply is truthy the callback will be called with all modules that were disposed. * apply() is automatically called with autoApply as options parameter. * If autoApply is not set the callback will be called with all modules that will be disposed on apply(). - * * @param autoApply * @param callback */ @@ -172,14 +165,12 @@ export interface WebpackHot { * Check all currently loaded modules for updates and apply updates if found. * If no update was found, the callback is called with null. * The callback will be called with all modules that will be disposed on apply(). - * * @param callback */ check (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void /** * If status() != "ready" it throws an error. * Continue the update process. - * * @param options * @param callback */ @@ -187,7 +178,6 @@ export interface WebpackHot { /** * If status() != "ready" it throws an error. * Continue the update process. - * * @param callback */ apply (callback: (err: Error, outdatedModules: WebpackModuleId[]) => void): void @@ -201,7 +191,6 @@ export interface WebpackHot { addStatusHandler (callback: (status: string) => void): void /** * Remove a registered status change handler. - * * @param callback */ removeStatusHandler (callback: (status: string) => void): void diff --git a/packages/schema/src/types/compatibility.ts b/packages/schema/src/types/compatibility.ts index 63fe1d7fd9..3344af856e 100644 --- a/packages/schema/src/types/compatibility.ts +++ b/packages/schema/src/types/compatibility.ts @@ -1,7 +1,6 @@ export interface NuxtCompatibility { /** * Required nuxt version in semver format. - * * @example `^2.14.0` or `>=3.0.0-27219851.6e49637`. */ nuxt?: string diff --git a/packages/schema/src/types/components.ts b/packages/schema/src/types/components.ts index 6290f4961e..640119a941 100644 --- a/packages/schema/src/types/components.ts +++ b/packages/schema/src/types/components.ts @@ -111,7 +111,6 @@ export interface ComponentsOptions { * but they can also be used dynamically, for example ``. * * This can be overridden by an individual component directory entry. - * * @default false */ global?: boolean diff --git a/packages/schema/src/types/config.ts b/packages/schema/src/types/config.ts index cdfd08a68b..f1494dfc2f 100644 --- a/packages/schema/src/types/config.ts +++ b/packages/schema/src/types/config.ts @@ -88,7 +88,6 @@ export interface NuxtConfig extends DeepPartial { entry?: string /** * Options passed to @vitejs/plugin-vue. - * * @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue */ vue?: VuePluginOptions /** * Options passed to @vitejs/plugin-vue-jsx. - * * @see https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx */ vueJsx?: VueJsxPluginOptions /** * Bundler for dev time server-side rendering. - * * @default 'vite-node' */ devBundler?: 'vite-node' | 'legacy' @@ -158,7 +154,6 @@ export interface ViteConfig extends Omit { * Directly configuring the `vite.publicDir` option is not supported. Instead, set `dir.public`. * * You can read more in . - * * @deprecated */ publicDir?: never diff --git a/packages/schema/src/types/head.ts b/packages/schema/src/types/head.ts index b7a9d265bf..70f54cf04b 100644 --- a/packages/schema/src/types/head.ts +++ b/packages/schema/src/types/head.ts @@ -19,14 +19,12 @@ export type MetaObject = MetaObjectRaw export type AppHeadMetaObject = MetaObjectRaw & { /** * The character encoding in which the document is encoded => `` - * * @default `'utf-8'` */ charset?: string /** * Configuration of the viewport (the area of the window in which web content can be seen), * mapped to => `` - * * @default `'width=device-width, initial-scale=1'` */ viewport?: string diff --git a/packages/schema/src/types/hooks.ts b/packages/schema/src/types/hooks.ts index 99d727939b..e6e7fad28d 100644 --- a/packages/schema/src/types/hooks.ts +++ b/packages/schema/src/types/hooks.ts @@ -65,7 +65,6 @@ export interface NuxtHooks { // Kit /** * Allows extending compatibility checks. - * * @param compatibility Compatibility object * @param issues Issues to be mapped * @returns Promise @@ -75,21 +74,18 @@ export interface NuxtHooks { // Nuxt /** * Called after Nuxt initialization, when the Nuxt instance is ready to work. - * * @param nuxt The configured Nuxt object * @returns Promise */ 'ready': (nuxt: Nuxt) => HookResult /** * Called when Nuxt instance is gracefully closing. - * * @param nuxt The configured Nuxt object * @returns Promise */ 'close': (nuxt: Nuxt) => HookResult /** * Called to restart the current Nuxt instance. - * * @returns Promise */ 'restart': (options?: { @@ -101,34 +97,29 @@ export interface NuxtHooks { /** * Called during Nuxt initialization, before installing user modules. - * * @returns Promise */ 'modules:before': () => HookResult /** * Called during Nuxt initialization, after installing user modules. - * * @returns Promise */ 'modules:done': () => HookResult /** * Called after resolving the `app` instance. - * * @param app The resolved `NuxtApp` object * @returns Promise */ 'app:resolve': (app: NuxtApp) => HookResult /** * Called during `NuxtApp` generation, to allow customizing, modifying or adding new files to the build directory (either virtually or to written to `.nuxt`). - * * @param app The configured `NuxtApp` object * @returns Promise */ 'app:templates': (app: NuxtApp) => HookResult /** * Called after templates are compiled into the [virtual file system](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) (vfs). - * * @param app The configured `NuxtApp` object * @returns Promise */ @@ -136,19 +127,16 @@ export interface NuxtHooks { /** * Called before Nuxt bundle builder. - * * @returns Promise */ 'build:before': () => HookResult /** * Called after Nuxt bundle builder is complete. - * * @returns Promise */ 'build:done': () => HookResult /** * Called during the manifest build by Vite and Webpack. This allows customizing the manifest that Nitro will use to render `