chore: ignore eslint warnings about console logging (#28795)

This commit is contained in:
Joaquín Sánchez 2024-09-03 10:39:15 +02:00 committed by Daniel Roe
parent de48f2653a
commit db90f7d12b
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -103,6 +103,7 @@ async function initNuxt (nuxt: Nuxt) {
const shouldShowPrompt = nuxt.options.dev && hasTTY && !isCI const shouldShowPrompt = nuxt.options.dev && hasTTY && !isCI
if (!shouldShowPrompt) { if (!shouldShowPrompt) {
// eslint-disable-next-line no-console
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`) console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
} }
@ -112,6 +113,7 @@ async function initNuxt (nuxt: Nuxt) {
default: true, default: true,
}) })
if (result !== true) { if (result !== true) {
// eslint-disable-next-line no-console
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`) console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
return return
} }
@ -146,6 +148,7 @@ async function initNuxt (nuxt: Nuxt) {
consola.error(`Failed to update config: ${message}`) consola.error(`Failed to update config: ${message}`)
} }
// eslint-disable-next-line no-console
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`) console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
} }
@ -155,6 +158,7 @@ async function initNuxt (nuxt: Nuxt) {
nitro.hooks.hookOnce('compiled', () => { nitro.hooks.hookOnce('compiled', () => {
warnedAboutCompatDate = true warnedAboutCompatDate = true
// Print warning // Print warning
// eslint-disable-next-line no-console
console.info(`Nuxt now supports pinning the behavior of provider and deployment presets with a compatibility date. We recommend you specify a \`compatibilityDate\` in your \`nuxt.config\` file, or set an environment variable, such as \`COMPATIBILITY_DATE=${todaysDate}\`.`) console.info(`Nuxt now supports pinning the behavior of provider and deployment presets with a compatibility date. We recommend you specify a \`compatibilityDate\` in your \`nuxt.config\` file, or set an environment variable, such as \`COMPATIBILITY_DATE=${todaysDate}\`.`)
if (shouldShowPrompt) { promptAndUpdate() } if (shouldShowPrompt) { promptAndUpdate() }
}) })
@ -665,6 +669,7 @@ async function initNuxt (nuxt: Nuxt) {
// Show compatibility version banner when Nuxt is running with a compatibility version // Show compatibility version banner when Nuxt is running with a compatibility version
// that is different from the current major version // that is different from the current major version
if (!(satisfies(nuxt._version, nuxt.options.future.compatibilityVersion + '.x'))) { if (!(satisfies(nuxt._version, nuxt.options.future.compatibilityVersion + '.x'))) {
// eslint-disable-next-line no-console
console.info(`Running with compatibility version \`${nuxt.options.future.compatibilityVersion}\``) console.info(`Running with compatibility version \`${nuxt.options.future.compatibilityVersion}\``)
} }