Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublicRuntimeConfig type not being recognized by eslint, only happens after nuxt 3.11.2 with i18n active #2952

Closed
allusernamestakenexceptthis opened this issue May 23, 2024 · 1 comment

Comments

@allusernamestakenexceptthis

Environment

Operating System: Linux
Node Version: v18.18.0
Nuxt Version: 3.11.2
CLI Version: 3.11.1
Nitro Version: 2.9.6
Package Manager: npm@10.2.3
Builder: -
User Config: modules, runtimeConfig
Runtime Modules: @nuxtjs/i18n@8.3.1, @sidebase/nuxt-auth@0.7.2, @nuxt/eslint@0.3.13
Build Modules: -

Reproduction

https://stackblitz.com/edit/github-m5xc5v?file=nuxt.config.ts

Describe the bug

I'm not certain if it is i18n bug. but I'm posting it here too. because it only happens with @nuxtjs/i18n active and nuxt 3.11.2. someone here might know the reason. however it only happens when another module also active: @sidebase/nuxt-auth

The issue:
Public runtime config properties types are not recognized when running eslint. they appear as any. even when declaring nuxt/schema

This happens only with nuxt 3.11 and installing two modules: @nuxtjs/i18n' and '@sidebase/nuxt-auth and including them in nuxt.config.ts

in the reproduction terminal, you can ctrl+c, then:

npm run lint

you'll get:

error Unexpected any value in conditional. An explicit comparison or type cast is required @typescript-eslint/strict-boolean-expressions

if you remove either of those two modules from nuxt-config.ts, eslint doesn't report an error.

Additional context

No response

Logs

No response

@BobbieGoede
Copy link
Collaborator

This issue was caused by types provided by @sidebase/nuxt-auth (same as #2915), I already fixed it on their end with sidebase/nuxt-auth#738 which is included in their 0.8.0-alpha.1 release. I have updated your reproduction to demonstrate here.

Since it's already been resolved I'll close this issue, let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants